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 zeroTermsQuery for matchPhraseQuery #648

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Conversation

swethakann
Copy link
Contributor

Support returning all or no docs if the analyzer removes all tokens in a match query.

Requirements

  • If zero_terms_query is set to “all”, it should return all the documents similar to match_all query
  • By default, match no docs

@@ -190,6 +190,7 @@ message MatchPhraseQuery {
string query = 2; // The text to query with.
int32 slop = 3; // Edit distance between respective positions of tokens generated by analyzing this query and the positions of terms in a document.
Analyzer analyzer = 4; // Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
string zeroTermsQuery = 5; // Optional field. Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are "none" and "all".
Copy link
Contributor

Choose a reason for hiding this comment

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

If this only has two possible values, could it be an enum?

@swethakann swethakann requested a review from aprudhomme April 16, 2024 16:03
@swethakann swethakann merged commit ed29d9f into master Apr 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants