nychealth / EH-dataportal

Source code for the Environment & Health Data Portal
https://a816-dohbesp.nyc.gov/IndicatorPublic/
Apache License 2.0
10 stars 4 forks source link

Pagefind sub-results ranking #992

Open cgettings opened 6 months ago

cgettings commented 6 months ago

pagefind's default behavior when showing sub-results seems to be: show the first 3 sub-results, implicitly ranked by the order in which they appear on the page.

So, the search term "smoke asthma" returns

image

because of this

image

even though "Mold in homes" has one hit with a score of 39574, and "Secondhand smoke at home" has 3 hits with scores of 69456, 51029, and 51029.

Each result contains all matching sub-results, so we could figure out how to overwrite the displayed sub-results with an arbitrary number sorted by balanced_score.

Would be moot if the pagefind team changes the default behavior, and I might submit an issue over there.

mmontesanonyc commented 1 month ago

A few other enhancements:

NB: a lot of our site-search terms are for neighborhoods - neighborhood names, including ZIP Codes. Search should absolutely return useful results for neighborhood names, ZIPs, etc.

CC @cgettings