algolia / hn-search

Hacker News Search
http://hn.algolia.com
Other
550 stars 74 forks source link

fix(search): set minProximity to 7 instead of 8 #222

Closed julienpa closed 2 years ago

julienpa commented 2 years ago

Fix proximity not being taken into account when minProximity is 8

julienpa commented 2 years ago

@jzck flagging you mostly for the deployement: once merge, is this going to be deployed automatically or is there a manual step? Thanks!

Haroenv commented 2 years ago

sorry, I don't understand why this is changed @julienpa

julienpa commented 2 years ago

@Haroenv the initial goal of minProximity=8 is to prioritize different words matching within the same attribute comapred to records where the same words match in different attributes. Either this assumption was wrong or the implementation of (min)proximity changed since this was implemented, but today using minProximity=8 actually disables proximity as it will set 8 for all matches regardless of where they are, effectivelly rendering it useless. So this is causing relevancy issues on HN and this PR intends to fix it with 7 which will be the closest behavior from the one intended originally.