Class MultiMatchQuery.Builder

All Implemented Interfaces:
WithJson<MultiMatchQuery.Builder>, ObjectBuilder<MultiMatchQuery>
Enclosing class:
MultiMatchQuery

public static class MultiMatchQuery.Builder extends QueryBase.AbstractBuilder<MultiMatchQuery.Builder> implements ObjectBuilder<MultiMatchQuery>
Builder for MultiMatchQuery.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • analyzer

      public final MultiMatchQuery.Builder analyzer(@Nullable String value)
      Analyzer used to convert the text in the query value into tokens.

      API name: analyzer

    • autoGenerateSynonymsPhraseQuery

      public final MultiMatchQuery.Builder autoGenerateSynonymsPhraseQuery(@Nullable Boolean value)
      If true, match phrase queries are automatically created for multi-term synonyms.

      API name: auto_generate_synonyms_phrase_query

    • cutoffFrequency

      @Deprecated public final MultiMatchQuery.Builder cutoffFrequency(@Nullable Double value)
      Deprecated.
      7.3.0
      API name: cutoff_frequency
    • fields

      public final MultiMatchQuery.Builder fields(List<String> list)
      The fields to be queried. Defaults to the index.query.default_field index settings, which in turn defaults to *.

      API name: fields

      Adds all elements of list to fields.

    • fields

      public final MultiMatchQuery.Builder fields(String value, String... values)
      The fields to be queried. Defaults to the index.query.default_field index settings, which in turn defaults to *.

      API name: fields

      Adds one or more values to fields.

    • fuzziness

      public final MultiMatchQuery.Builder fuzziness(@Nullable String value)
      Maximum edit distance allowed for matching.

      API name: fuzziness

    • fuzzyRewrite

      public final MultiMatchQuery.Builder fuzzyRewrite(@Nullable String value)
      Method used to rewrite the query.

      API name: fuzzy_rewrite

    • fuzzyTranspositions

      public final MultiMatchQuery.Builder fuzzyTranspositions(@Nullable Boolean value)
      If true, edits for fuzzy matching include transpositions of two adjacent characters (for example, ab to ba). Can be applied to the term subqueries constructed for all terms but the final term.

      API name: fuzzy_transpositions

    • lenient

      public final MultiMatchQuery.Builder lenient(@Nullable Boolean value)
      If true, format-based errors, such as providing a text query value for a numeric field, are ignored.

      API name: lenient

    • maxExpansions

      public final MultiMatchQuery.Builder maxExpansions(@Nullable Integer value)
      Maximum number of terms to which the query will expand.

      API name: max_expansions

    • minimumShouldMatch

      public final MultiMatchQuery.Builder minimumShouldMatch(@Nullable String value)
      Minimum number of clauses that must match for a document to be returned.

      API name: minimum_should_match

    • operator

      public final MultiMatchQuery.Builder operator(@Nullable Operator value)
      Boolean logic used to interpret text in the query value.

      API name: operator

    • prefixLength

      public final MultiMatchQuery.Builder prefixLength(@Nullable Integer value)
      Number of beginning characters left unchanged for fuzzy matching.

      API name: prefix_length

    • query

      public final MultiMatchQuery.Builder query(String value)
      Required - Text, number, boolean value or date you wish to find in the provided field.

      API name: query

    • slop

      public final MultiMatchQuery.Builder slop(@Nullable Integer value)
      Maximum number of positions allowed between matching tokens.

      API name: slop

    • tieBreaker

      public final MultiMatchQuery.Builder tieBreaker(@Nullable Double value)
      Determines how scores for each per-term blended query and scores across groups are combined.

      API name: tie_breaker

    • type

      public final MultiMatchQuery.Builder type(@Nullable TextQueryType value)
      How the multi_match query is executed internally.

      API name: type

    • zeroTermsQuery

      public final MultiMatchQuery.Builder zeroTermsQuery(@Nullable ZeroTermsQuery value)
      Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter.

      API name: zero_terms_query

    • self

      protected MultiMatchQuery.Builder self()
      Specified by:
      self in class QueryBase.AbstractBuilder<MultiMatchQuery.Builder>
    • build

      public MultiMatchQuery build()
      Builds a MultiMatchQuery.
      Specified by:
      build in interface ObjectBuilder<MultiMatchQuery>
      Throws:
      NullPointerException - if some of the required fields are null.