Class Fuzziness

java.lang.Object
org.elasticsearch.common.unit.Fuzziness
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentFragment

public final class Fuzziness extends Object implements org.elasticsearch.xcontent.ToXContentFragment, Writeable
A unit class that encapsulates all in-exact search parsing and conversion from similarities to edit distances etc.
  • Field Details

    • X_FIELD_NAME

      public static final String X_FIELD_NAME
      See Also:
    • ZERO

      public static final Fuzziness ZERO
    • ONE

      public static final Fuzziness ONE
    • TWO

      public static final Fuzziness TWO
    • AUTO

      public static final Fuzziness AUTO
    • FIELD

      public static final org.elasticsearch.xcontent.ParseField FIELD
  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • fromEdits

      public static Fuzziness fromEdits(int edits)
      Creates a Fuzziness instance from an edit distance. The value must be one of [0, 1, 2] Note: Using this method only makes sense if the field you are applying Fuzziness to is some sort of string.
    • build

      public static Fuzziness build(Object fuzziness)
    • parse

      public static Fuzziness parse(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • asDistance

      public int asDistance()
    • asDistance

      public int asDistance(String text)
    • asFloat

      public float asFloat()
    • asString

      public String asString()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object