Multi-Match QueryΒΆ

A query that creates a match type query for each field provided and wraps all the match queries in a DisjunctionMaxQuery.

Proto definition:

message MultiMatchQuery {
    // Type defining the execution behavior of the match.
    enum MatchType {
        // Finds documents which match any field, but uses the _score from the best field.
        BEST_FIELDS = 0;
        // Runs a MatchPhrasePrefixQuery query on each field and uses the _score from the best field.
        PHRASE_PREFIX = 1;
        // Finds documents that match across multiple fields, as if they were a single field.
        CROSS_FIELDS = 2;
    }

    repeated string fields = 1; // Fields in the document to query.
    string query = 2; // The text to query with.
    map<string, float> fieldBoosts = 3; // Boosts for each field, if any.
    MatchOperator operator = 4; // Boolean logic used to interpret text in the query. The possible values are SHOULD (default) and MUST.
    int32 minimumNumberShouldMatch = 5; // Minimum number of optional clauses that must match.
    Analyzer analyzer = 6; // Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
    FuzzyParams fuzzyParams = 7; // Parameters to set the fuzziness of the query
    float tieBreakerMultiplier = 8; // The score of each non-maximum match query disjunct for a document will be multiplied by this weight and added into the final score.
    // Type defining match behavior of query.
    MatchType type = 9;
    // Edit distance between respective positions of tokens generated by analyzing this query and the positions of terms in a document, applies to PHRASE_PREFIX type matching.
    int32 slop = 10;
    // Maximum number of terms to which the prefix token will expand when using PHRASE_PREFIX matching. Defaults to 50.
    int32 maxExpansions = 11;
}