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

Use QueryVisitor when extracting PercolatorQuery list for highlighting #53728

Merged
merged 2 commits into from
Mar 18, 2020

Conversation

romseygeek
Copy link
Contributor

The highlighting phase for percolator queries currently uses some custom query
traversal logic to find all instances of PercolatorQuery in the query tree for the
current search context. This commit converts things to instead use a QueryVisitor,
which future-proofs us against new wrapper queries or queries from custom
plugins that the percolator module doesn't know about.

@romseygeek romseygeek added :Search Relevance/Percolator Reverse search: find queries that match a document >refactoring v8.0.0 v7.7.0 labels Mar 18, 2020
@romseygeek romseygeek requested a review from martijnvg March 18, 2020 13:55
@romseygeek romseygeek self-assigned this Mar 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Percolator)

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@romseygeek romseygeek merged commit ddaf353 into elastic:master Mar 18, 2020
@romseygeek romseygeek deleted the percolator/hl-visitor branch March 18, 2020 15:18
romseygeek added a commit that referenced this pull request Mar 18, 2020
#53728)

The highlighting phase for percolator queries currently uses some custom query
traversal logic to find all instances of PercolatorQuery in the query tree for the
current search context. This commit converts things to instead use a QueryVisitor,
which future-proofs us against new wrapper queries or queries from custom
plugins that the percolator module doesn't know about.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Search Relevance/Percolator Reverse search: find queries that match a document v7.7.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants