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

Add support for MatchNoDocsQuery in percolator's query terms extract service #18492

Merged
merged 1 commit into from May 22, 2016

Conversation

Projects
None yet
2 participants
@martijnvg
Copy link
Member

commented May 20, 2016

A percolate query that should have no matches was taking too long to execute. After some debugging I found that the 900k match query only contained stopwords. If a match query's text analysis returns no tokens it returns a MatchNoDocsQuery Lucene query. So the percolator was 'evaluating' 900k MatchNoDocsQuery queries... This PR fixes that.


The selecting of candidate percolator queries matches is an important performance optimization during the execution
of the `percolate` query as it can significantly reduce the number of candidate matches the in-memory index need to

This comment has been minimized.

Copy link
@abeyad

abeyad May 20, 2016

Contributor

nit: /s/need/needs

@abeyad

This comment has been minimized.

Copy link
Contributor

commented May 20, 2016

LGTM. Very small nit comment

percolator: Add support dor MatchNoDocsQuery in query terms extract s…
…ervice

Before the query extraction would have been aborted and the percolator query would be marked as unknown.
This resulted in a situation that these queries always need to be evaluated by the memory index at search time.
By adding support for this query many more percolator query candidate hits can skip the expensive memory index verification step. For example the `match` query parser returns a MatchNoDocsQuery if the query terms are removed by text analysis (lets query text only contained stop words).

@martijnvg martijnvg force-pushed the martijnvg:percolator_match_no_docs_query branch to c1a0929 May 22, 2016

@martijnvg martijnvg merged commit c1a0929 into elastic:master May 22, 2016

1 check passed

CLA Commit author is a member of Elasticsearch
Details
@martijnvg

This comment has been minimized.

Copy link
Member Author

commented May 22, 2016

thx @abeyad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.