Class FuzzyQueryBuilder

java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<FuzzyQueryBuilder>
org.elasticsearch.index.query.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 java.lang.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​(java.lang.String fieldName, java.lang.String value)
      Constructs a new fuzzy query.
      Parameters:
      fieldName - The name of the field
      value - The value of the text
    • FuzzyQueryBuilder

      public FuzzyQueryBuilder​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String fieldName, java.lang.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 java.io.IOException
      Read from a stream.
      Throws:
      java.io.IOException
  • Method Details