komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.83k stars 278 forks source link

Do not allow skipping words on two word queries #702

Closed lonvia closed 1 year ago

lonvia commented 1 year ago

In two-word queries with a typo, ES tends to prefer skipping the word with the typo over a fuzzy match. For example, https://photon.komoot.io/api/?q=eifelturm%20paris&lang=de rather returns Paris (skipping 'Eifelturm') instead of the obvious fuzzy match of 'Eiffelturm, Paris'.

This disables the word skipping for two-word queries. We can't really do it for three-word queries as we might want to skip over the house number in a query like 'Hauptstr 34, Berlin'.