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

Improvements to query parsing #3321

Merged
merged 6 commits into from
Jan 28, 2024

Conversation

lonvia
Copy link
Member

@lonvia lonvia commented Jan 28, 2024

This fixes a few smaller issues in the code that parses and interprets the queries found when looking into long-running requests on our production servers. It mainly makes searches a tiny bit faster.

  • avoid duplicates in the token lists used in SQL queries
  • try to avoid index use on the address index against very frequent tokens
  • category words should not appear in the middle or a query string or be used together with housenumber-only searches
  • make sure penalties for housenumber-only searches are comparable with the equivalent named address search

This messes with the estimates for expected results.
This already worked for left-to-right readings and now is also
implemented for right-to-left reading. A qualifier must always be
before or after the name.
If there already was a search by full names, the search is likely
a repeatition that yields the same results, only running slower.
A normal address search with housenumber will use name rankings for
the street name. This is slightly different than weighing for
address parts. Use the same ranking for the first part of the
address for housenumber-only searches to make sure that penalties
remain comparable.
@lonvia lonvia merged commit 3cc3e3b into osm-search:master Jan 28, 2024
9 checks passed
@lonvia lonvia deleted the remove-duplicate-partials branch January 28, 2024 19:33
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