public final class Fuzziness extends java.lang.Object implements ToXContent, Writeable
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field and Description |
---|---|
static Fuzziness |
AUTO |
static ParseField |
FIELD |
static Fuzziness |
ONE |
static Fuzziness |
TWO |
static java.lang.String |
X_FIELD_NAME |
static Fuzziness |
ZERO |
EMPTY_PARAMS
Constructor and Description |
---|
Fuzziness(StreamInput in)
Read from a stream.
|
Modifier and Type | Method and Description |
---|---|
int |
asDistance() |
int |
asDistance(java.lang.String text) |
float |
asFloat() |
java.lang.String |
asString() |
static Fuzziness |
build(java.lang.Object fuzziness) |
boolean |
equals(java.lang.Object obj) |
static Fuzziness |
fromEdits(int edits)
Creates a
Fuzziness instance from an edit distance. |
int |
hashCode() |
static Fuzziness |
parse(XContentParser parser) |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params,
boolean includeFieldName) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFragment
public static final java.lang.String X_FIELD_NAME
public static final Fuzziness ZERO
public static final Fuzziness ONE
public static final Fuzziness TWO
public static final Fuzziness AUTO
public static final ParseField FIELD
public Fuzziness(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public static Fuzziness fromEdits(int edits)
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.public static Fuzziness build(java.lang.Object fuzziness)
public static Fuzziness parse(XContentParser parser) throws java.io.IOException
java.io.IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params, boolean includeFieldName) throws java.io.IOException
java.io.IOException
public int asDistance()
public int asDistance(java.lang.String text)
public float asFloat()
public java.lang.String asString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object