feat(query): Use match_all for subquery matching#1356
Merged
orangejulius merged 1 commit intomasterfrom Oct 3, 2019
Merged
Conversation
missinglink
approved these changes
Oct 1, 2019
Member
missinglink
left a comment
There was a problem hiding this comment.
Nice, I like the simplicity of it.
I think this is a good candidate for a canary release against real-world data because it's more likely to have an effect on performance than result quality.
This PR brings the `search_pelias_parser` queries into alignment with autocomplete and `search` queries by using the `match_all` query, instead of a phrase query, for use with function scoring to apply boosts for popularity and population. While in theory this could result in longer query times because the population and popularity scoring will be applied to more documents, its unlikely we'll notice that. However, what we _would_ notice is if there's highly populated or popular record that does not match the phrase subquery, but does match the non-phrase query.
dbc6f34 to
7c2e98e
Compare
Merged
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR brings the
search_pelias_parserqueries into alignment with autocomplete andsearchqueries by using thematch_allquery, instead of a phrase query, for use with function scoring to apply boosts for popularity and population.While in theory this could result in longer query times because the population and popularity scoring will be applied to more documents, its unlikely we'll notice that.
However, what we would notice is if there's highly populated or popular record that does not match the phrase subquery, but does match the non-phrase query.
All that said, there are no changes to the acceptance tests with this change, so we can mostly consider it a pure refactoring that reduces complexity and technical debt.