datacommonsorg / website

Code for the Data Commons website
https://datacommons.org
Apache License 2.0
24 stars 88 forks source link

Modify the autocomplete processing logic to improve results #4667

Closed gmechali closed 1 month ago

gmechali commented 1 month ago

Negates the "score", best match has lowest score. This allows us to sort with the first results being the best matches, but preserves the Google Maps ordering for same score responses. Cleans up the logic a bit to remove dupes at the end. The new sorting requires computing all scores, so this deduping at the end doesnt lead to useless processing. When computing score, take into account the ordering of the words. This significantly improves the results from my testing.