Skip to content

Correctly handle MSM for nested disjunctions#50669

Merged
romseygeek merged 3 commits intoelastic:masterfrom
romseygeek:bug/percolator-testduel
Jan 7, 2020
Merged

Correctly handle MSM for nested disjunctions#50669
romseygeek merged 3 commits intoelastic:masterfrom
romseygeek:bug/percolator-testduel

Conversation

@romseygeek
Copy link
Copy Markdown
Contributor

@romseygeek romseygeek commented Jan 6, 2020

With the rewrite of the percolator's QueryAnalyzer to use lucene's QueryVisitor API,
term queries that are direct children of a boolean query are handled separately from
other children. This works fine for conjunctions, but for disjunctions we need to
treat the extracted terms from these direct descendents along with extractions from
more deeply nested children to ensure that minimum-should-match requirements
are met correctly.

This commit changes the logic in QueryAnalyzer#getResult() to bundle child term
results with all other results before handling them.

Fixes #50305

@romseygeek romseygeek added >bug :Search Relevance/Percolator Reverse search: find queries that match a document v8.0.0 v7.6.0 labels Jan 6, 2020
@romseygeek romseygeek self-assigned this Jan 6, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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.

Good catch!

@romseygeek romseygeek merged commit 0bbae8a into elastic:master Jan 7, 2020
@romseygeek romseygeek deleted the bug/percolator-testduel branch January 7, 2020 09:31
romseygeek added a commit that referenced this pull request Jan 7, 2020
With the rewrite of the percolator's QueryAnalyzer to use lucene's QueryVisitor API,
term queries that are direct children of a boolean query are handled separately from
other children. This works fine for conjunctions, but for disjunctions we need to
treat the extracted terms from these direct descendents along with extractions from
more deeply nested children to ensure that minimum-should-match requirements
are met correctly.

This commit changes the logic in QueryAnalyzer#getResult() to bundle child term
results with all other results before handling them.

Fixes #50305
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
With the rewrite of the percolator's QueryAnalyzer to use lucene's QueryVisitor API,
term queries that are direct children of a boolean query are handled separately from
other children. This works fine for conjunctions, but for disjunctions we need to
treat the extracted terms from these direct descendents along with extractions from
more deeply nested children to ensure that minimum-should-match requirements
are met correctly.

This commit changes the logic in QueryAnalyzer#getResult() to bundle child term
results with all other results before handling them.

Fixes elastic#50305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Search Relevance/Percolator Reverse search: find queries that match a document v7.6.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] org.elasticsearch.percolator.CandidateQueryTests.testDuel failure

4 participants