NamedWriteable, Writeable, ToXContent, ToXContentObject, MultiTermQueryBuilder, QueryBuilder, Rewriteable<QueryBuilder>public class FuzzyQueryBuilder extends AbstractQueryBuilder<FuzzyQueryBuilder> implements MultiTermQueryBuilder
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field | Description |
|---|---|---|
static Fuzziness |
DEFAULT_FUZZINESS |
Default maximum edit distance.
|
static int |
DEFAULT_MAX_EXPANSIONS |
Default maximum number of terms that the fuzzy query will expand to.
|
static int |
DEFAULT_PREFIX_LENGTH |
Default number of initial characters which will not be “fuzzified”.
|
static boolean |
DEFAULT_TRANSPOSITIONS |
Default as to whether transpositions should be treated as a primitive edit operation,
instead of classic Levenshtein algorithm.
|
static java.lang.String |
NAME |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryNameMAX_REWRITE_ROUNDSEMPTY_PARAMS| Constructor | Description |
|---|---|
FuzzyQueryBuilder(java.lang.String fieldName,
boolean value) |
Constructs a new fuzzy query.
|
FuzzyQueryBuilder(java.lang.String fieldName,
double value) |
Constructs a new fuzzy query.
|
FuzzyQueryBuilder(java.lang.String fieldName,
float value) |
Constructs a new fuzzy query.
|
FuzzyQueryBuilder(java.lang.String fieldName,
int value) |
Constructs a new fuzzy query.
|
FuzzyQueryBuilder(java.lang.String fieldName,
long value) |
Constructs a new fuzzy query.
|
FuzzyQueryBuilder(java.lang.String fieldName,
java.lang.Object value) |
Constructs a new fuzzy query.
|
FuzzyQueryBuilder(java.lang.String fieldName,
java.lang.String value) |
Constructs a new fuzzy query.
|
FuzzyQueryBuilder(StreamInput in) |
Read from a stream.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
doEquals(FuzzyQueryBuilder other) |
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
|
protected org.apache.lucene.search.Query |
doToQuery(QueryShardContext context) |
|
protected void |
doWriteTo(StreamOutput out) |
|
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
|
java.lang.String |
fieldName() |
|
static FuzzyQueryBuilder |
fromXContent(XContentParser parser) |
|
Fuzziness |
fuzziness() |
|
FuzzyQueryBuilder |
fuzziness(Fuzziness fuzziness) |
|
java.lang.String |
getWriteableName() |
Returns the name of the writeable object
|
int |
maxExpansions() |
|
FuzzyQueryBuilder |
maxExpansions(int maxExpansions) |
|
int |
prefixLength() |
|
FuzzyQueryBuilder |
prefixLength(int prefixLength) |
|
java.lang.String |
rewrite() |
|
FuzzyQueryBuilder |
rewrite(java.lang.String rewrite) |
|
boolean |
transpositions() |
|
FuzzyQueryBuilder |
transpositions(boolean transpositions) |
|
java.lang.Object |
value() |
addValidationError, boost, boost, declareStandardFields, doRewrite, equals, extractInnerHitBuilders, getName, hashCode, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQuery, toString, toXContent, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitboost, boost, getName, queryName, queryName, rewrite, toFilter, toQueryrewrite, rewrite, rewrite, rewriteAndFetch, rewriteAndFetchtoXContentisFragmentpublic static final java.lang.String NAME
public static final Fuzziness DEFAULT_FUZZINESS
public static final int DEFAULT_PREFIX_LENGTH
public static final int DEFAULT_MAX_EXPANSIONS
public static final boolean DEFAULT_TRANSPOSITIONS
public FuzzyQueryBuilder(java.lang.String fieldName,
java.lang.String value)
fieldName - The name of the fieldvalue - The value of the textpublic FuzzyQueryBuilder(java.lang.String fieldName,
int value)
fieldName - The name of the fieldvalue - The value of the textpublic FuzzyQueryBuilder(java.lang.String fieldName,
long value)
fieldName - The name of the fieldvalue - The value of the textpublic FuzzyQueryBuilder(java.lang.String fieldName,
float value)
fieldName - The name of the fieldvalue - The value of the textpublic FuzzyQueryBuilder(java.lang.String fieldName,
double value)
fieldName - The name of the fieldvalue - The value of the textpublic FuzzyQueryBuilder(java.lang.String fieldName,
boolean value)
fieldName - The name of the fieldvalue - The value of the textpublic FuzzyQueryBuilder(java.lang.String fieldName,
java.lang.Object value)
fieldName - The name of the fieldvalue - The value of the termpublic FuzzyQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionprotected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo in class AbstractQueryBuilder<FuzzyQueryBuilder>java.io.IOExceptionpublic java.lang.String fieldName()
public java.lang.Object value()
public FuzzyQueryBuilder fuzziness(Fuzziness fuzziness)
public Fuzziness fuzziness()
public FuzzyQueryBuilder prefixLength(int prefixLength)
public int prefixLength()
public FuzzyQueryBuilder maxExpansions(int maxExpansions)
public int maxExpansions()
public FuzzyQueryBuilder transpositions(boolean transpositions)
public boolean transpositions()
public FuzzyQueryBuilder rewrite(java.lang.String rewrite)
public java.lang.String rewrite()
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent in class AbstractQueryBuilder<FuzzyQueryBuilder>java.io.IOExceptionpublic static FuzzyQueryBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getWriteableName()
NamedWriteablegetWriteableName in interface NamedWriteableprotected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery in class AbstractQueryBuilder<FuzzyQueryBuilder>java.io.IOExceptionprotected int doHashCode()
doHashCode in class AbstractQueryBuilder<FuzzyQueryBuilder>protected boolean doEquals(FuzzyQueryBuilder other)
AbstractQueryBuilderQueryBuilder object of the same type is "equal to" this one.doEquals in class AbstractQueryBuilder<FuzzyQueryBuilder>