Package org.elasticsearch.common.unit
Class Fuzziness
java.lang.Object
org.elasticsearch.common.unit.Fuzziness
- All Implemented Interfaces:
Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public final class Fuzziness
extends Object
implements org.elasticsearch.common.xcontent.ToXContentFragment, Writeable
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.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic Fuzziness
static org.elasticsearch.common.xcontent.ParseField
static Fuzziness
static Fuzziness
static String
static Fuzziness
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
asDistance(String text)
float
asFloat()
asString()
static Fuzziness
boolean
static Fuzziness
fromEdits(int edits)
Creates aFuzziness
instance from an edit distance.int
hashCode()
static Fuzziness
parse(org.elasticsearch.common.xcontent.XContentParser parser)
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
X_FIELD_NAME
- See Also:
- Constant Field Values
-
ZERO
-
ONE
-
TWO
-
AUTO
-
FIELD
public static final org.elasticsearch.common.xcontent.ParseField FIELD
-
-
Constructor Details
-
Fuzziness
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
fromEdits
Creates aFuzziness
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
-
parse
public static Fuzziness parse(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- Throws:
IOException
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
asDistance
public int asDistance() -
asDistance
-
asFloat
public float asFloat() -
asString
-
equals
-
hashCode
public int hashCode()
-