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

Search performance - better caching logic for queries on wildcard field #76035

Merged
merged 7 commits into from
Aug 5, 2021

Conversation

markharwood
Copy link
Contributor

@markharwood markharwood commented Aug 3, 2021

Remove use of BooleanQuery in WildcardField regex/wildcard/fuzzy/prefix searches to prevent query caching framework from running the contained verification query clauses across whole index at great expense.

The new BinaryDvConfirmedAutomatonQuery provides a replacement wrapper for the approximation and verification clauses that plays better with caching logic

Closes #75848

@markharwood markharwood added >enhancement :Search/Search Search-related issues that do not fall into other categories v8.0.0 labels Aug 3, 2021
@markharwood markharwood self-assigned this Aug 3, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Aug 3, 2021
@elasticmachine
Copy link
Collaborator

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

@markharwood markharwood force-pushed the fix/75848 branch 2 times, most recently from a6d6c41 to 36d7a5b Compare August 3, 2021 16:48
Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

This looks good to me! I left some very minor comments.

…nning contained verification query clauses across whole index at great expense.

The new ApproximationAndVerificationQuery provides a replacement wrapper that plays better with caching logic

Closes elastic#75848
…Query which contains both the approximation (ngram index) query for acceleration and the automaton DV query.
@markharwood markharwood merged commit d805c67 into elastic:master Aug 5, 2021
// Bug if we have an indexed value but no doc value.
assert false;
// Bug if we have an indexed value (i.e an approxQuery) but no doc value.
assert approxQuery instanceof MatchAllDocsQuery == false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why this assertion changed? The original version seemed correct to me.

markharwood added a commit to markharwood/elasticsearch that referenced this pull request Aug 9, 2021
…ld (elastic#76035)

Remove use of BooleanQuery to prevent query caching framework from running contained verification query clauses across whole index at great expense.
The new BinaryDVConfirmedAutomatonQuery provides a replacement wrapper that plays better with caching logic

Closes elastic#75848
markharwood added a commit that referenced this pull request Aug 9, 2021
…ld (#76035) (#76182)

Backport to remove use of BooleanQuery to prevent query caching framework from running contained verification query clauses across whole index at great expense.
The new BinaryDVConfirmedAutomatonQuery provides a replacement wrapper that plays better with caching logic

Closes #75848
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v7.15.0 v8.0.0-alpha2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search - better caching logic for queries on wildcard field
4 participants