Class FuzzyQueryBuilder

All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, MultiTermQueryBuilder, QueryBuilder, Rewriteable<QueryBuilder>

public class FuzzyQueryBuilder extends AbstractQueryBuilder<FuzzyQueryBuilder> implements MultiTermQueryBuilder
A Query that does fuzzy matching for a specific value.
  • Field Details

    • NAME

      public static final String NAME
      See Also:
      Constant Field Values
    • DEFAULT_FUZZINESS

      public static final Fuzziness DEFAULT_FUZZINESS
      Default maximum edit distance. Defaults to AUTO.
    • DEFAULT_PREFIX_LENGTH

      public static final int DEFAULT_PREFIX_LENGTH
      Default number of initial characters which will not be “fuzzified”. Defaults to 0.
      See Also:
      Constant Field Values
    • DEFAULT_MAX_EXPANSIONS

      public static final int DEFAULT_MAX_EXPANSIONS
      Default maximum number of terms that the fuzzy query will expand to. Defaults to 50.
      See Also:
      Constant Field Values
    • DEFAULT_TRANSPOSITIONS

      public static final boolean DEFAULT_TRANSPOSITIONS
      Default as to whether transpositions should be treated as a primitive edit operation, instead of classic Levenshtein algorithm. Defaults to true.
      See Also:
      Constant Field Values
  • Constructor Details

    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(String fieldName, String value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the text
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(String fieldName, int value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the text
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(String fieldName, long value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the text
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(String fieldName, float value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the text
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(String fieldName, double value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the text
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(String fieldName, boolean value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the text
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(String fieldName, Object value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the term
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder(StreamInput in) throws IOException
      Read from a stream.
      Throws:
      IOException
  • Method Details