Package org.elasticsearch.common.unit
Class Fuzziness
java.lang.Object
org.elasticsearch.common.unit.Fuzziness
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
A unit class that encapsulates all in-exact search
parsing and conversion from similarities to edit distances
etc.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Fuzzinessstatic final ParseFieldstatic final Fuzzinessstatic final Fuzzinessstatic final Stringstatic final FuzzinessFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintasDistance(String text) floatasFloat()asString()static Fuzzinessbooleanstatic FuzzinessfromEdits(int edits) Creates aFuzzinessinstance from an edit distance.inthashCode()static Fuzzinessparse(XContentParser parser) toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
X_FIELD_NAME
- See Also:
-
ZERO
-
ONE
-
TWO
-
AUTO
-
FIELD
-
-
Constructor Details
-
Fuzziness
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
fromEdits
Creates aFuzzinessinstance 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
-
parse
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
asDistance
public int asDistance() -
asDistance
-
asFloat
public float asFloat() -
asString
-
equals
-
hashCode
public int hashCode()
-