Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More improvements to the Python search algorithm #3117

Merged
merged 11 commits into from
Jul 22, 2023

Conversation

lonvia
Copy link
Member

@lonvia lonvia commented Jul 21, 2023

Timing real-life search request uncovered some more inefficiencies in the query builder for search requests:

  • when searching for housenumbers as a name, there is no need to look up attached housenumbers
  • drop more searches that look to be searching for stop words only
  • block exceedingly long searches (they are more likely user input error and never yield usable results)
  • disallow a postcode in the first position when doing a classic address search

With these changes the geocoder-tester test suite now is performance-wise at par with the PHP implementation while finding more correct results.

lonvia added 11 commits July 17, 2023 16:27
The search still included a lookup of housenumbers in children which is
wrong.
They still should be preferrred over expensive partial name searches.
This only covers the case of <poi name> <street name> <housenumber>
which is exceedingly rare.
Avoid search against frequent partials if we have already looked for
the full name equivalents.
Move creation of field lookups in separate functions to make the code
more readable.
These are postcode searches and nothing else.
When phrases are typed, they should only contain exactly one term.
@lonvia lonvia merged commit 4a57863 into osm-search:master Jul 22, 2023
8 checks passed
@lonvia lonvia deleted the fix-assorted-search-errors branch July 22, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant