public class FuzzyQueryBuilder extends AbstractQueryBuilder<FuzzyQueryBuilder> implements MultiTermQueryBuilder
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and 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, queryName
EMPTY_PARAMS
MAX_REWRITE_ROUNDS
Constructor and Description |
---|
FuzzyQueryBuilder(StreamInput in)
Read from a stream.
|
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.
|
Modifier and Type | Method and 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, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
boost, boost, getName, queryName, queryName, rewrite, toFilter, toQuery
isFragment
toXContent
rewrite, rewrite, rewrite, rewriteAndFetch, rewriteAndFetch
public 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.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractQueryBuilder<FuzzyQueryBuilder>
java.io.IOException
public 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.IOException
public static FuzzyQueryBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public java.lang.String getWriteableName()
NamedWriteable
getWriteableName
in interface NamedWriteable
protected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery
in class AbstractQueryBuilder<FuzzyQueryBuilder>
java.io.IOException
protected int doHashCode()
doHashCode
in class AbstractQueryBuilder<FuzzyQueryBuilder>
protected boolean doEquals(FuzzyQueryBuilder other)
AbstractQueryBuilder
QueryBuilder
object of the same type is "equal to" this one.doEquals
in class AbstractQueryBuilder<FuzzyQueryBuilder>