Match Phrase QueryΒΆ

A query that analyzes the text before finding matching documents. The tokens resulting from the analysis are combined into a Lucene PhraseQuery.

Proto definition:

message MatchPhraseQuery {
    string field = 1; // Field in the document to query.
    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.
    ZeroTerms zeroTermsQuery = 5; // Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.

    // Zero Terms options when analyzer removes all tokens.
    enum ZeroTerms {
        // No documents are returned if the analyzer removes all tokens.
        NONE_ZERO_TERMS = 0;
        // All documents are returned if the analyzer removes all tokens.
        ALL_ZERO_TERMS = 1;
    }
}