Skip to content

Tweak query rematching to put larger weight on name match - #1097

Merged
lonvia merged 1 commit into
komoot:masterfrom
lonvia:tweak-rescoring
Jul 31, 2026
Merged

Tweak query rematching to put larger weight on name match#1097
lonvia merged 1 commit into
komoot:masterfrom
lonvia:tweak-rescoring

Conversation

@lonvia

@lonvia lonvia commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

This tweaks the rematching algorithm to put more weight on full name matches. In detail, it changes the following:

  • Name matching is done before address matching and gets a larger weight than a matching address.
  • Generally reduce match score for partial matches.
  • When a housenumber is present, then the primary matching is against the street name rather than the name of the object.
  • Country code and country name matches are only considered if they match completely and appear at the beginning or end of the query.

@henrik242 Could you give this a try to see if there are any regressions?

Comment thread src/main/java/de/komoot/photon/searcher/QueryReranker.java Outdated
Comment thread src/main/java/de/komoot/photon/searcher/QueryReranker.java
Comment thread src/main/java/de/komoot/photon/searcher/QueryReranker.java

@henrik242 henrik242 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lonvia No regressions that I can detect. Looks solid 👍🏻

* Name matching is done before address matching and gets a larger
  weight than a matching address.
* Generally reduce match score for partial matches.
* When a housenumber is present, then the primary matching is against
  the street name rather than the name of the object.
* Country code and country name matches are only considered if they
  match completely and appear at the beginning or end of the query.
@lonvia
lonvia force-pushed the tweak-rescoring branch from 3406571 to 40eae66 Compare July 30, 2026 08:52
@lonvia

lonvia commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 40eae66. Configure here.

@lonvia
lonvia merged commit 3a936f6 into komoot:master Jul 31, 2026
5 checks passed
@lonvia
lonvia deleted the tweak-rescoring branch July 31, 2026 10:10
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.

2 participants