FuzzyQuery
instead.@Deprecated public class SlowFuzzyQuery extends MultiTermQuery
Note that, unlike FuzzyQuery
, this query will silently allow
for a (possibly huge) number of edit distances in comparisons, and may
be extremely slow (comparing every term in the index).
MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBlendedFreqScoringRewrite, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite
Modifier and Type | Field and Description |
---|---|
static int |
defaultMaxExpansions
Deprecated.
|
static float |
defaultMinSimilarity
Deprecated.
|
static int |
defaultPrefixLength
Deprecated.
|
protected Term |
term
Deprecated.
|
CONSTANT_SCORE_BOOLEAN_REWRITE, CONSTANT_SCORE_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_REWRITE
Constructor and Description |
---|
SlowFuzzyQuery(Term term)
Deprecated.
|
SlowFuzzyQuery(Term term,
float minimumSimilarity)
Deprecated.
|
SlowFuzzyQuery(Term term,
float minimumSimilarity,
int prefixLength)
Deprecated.
|
SlowFuzzyQuery(Term term,
float minimumSimilarity,
int prefixLength,
int maxExpansions)
Deprecated.
Create a new SlowFuzzyQuery that will match terms with a similarity
of at least
minimumSimilarity to term . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Deprecated.
|
float |
getMinSimilarity()
Deprecated.
Returns the minimum similarity that is required for this query to match.
|
int |
getPrefixLength()
Deprecated.
Returns the non-fuzzy prefix length.
|
Term |
getTerm()
Deprecated.
Returns the pattern term.
|
protected TermsEnum |
getTermsEnum(Terms terms,
AttributeSource atts)
Deprecated.
|
int |
hashCode()
Deprecated.
|
String |
toString(String field)
Deprecated.
|
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethod
classHash, createWeight, sameClassAs, toString
public static final float defaultMinSimilarity
public static final int defaultPrefixLength
public static final int defaultMaxExpansions
protected Term term
public SlowFuzzyQuery(Term term, float minimumSimilarity, int prefixLength, int maxExpansions)
minimumSimilarity
to term
.
If a prefixLength
> 0 is specified, a common prefix
of that length is also required.term
- the term to search forminimumSimilarity
- a value between 0 and 1 to set the required similarity
between the query term and the matching terms. For example, for a
minimumSimilarity
of 0.5
a term of the same length
as the query term is considered similar to the query term if the edit distance
between both terms is less than length(term)*0.5
Alternatively, if minimumSimilarity
is >= 1f, it is interpreted
as a pure Levenshtein edit distance. For example, a value of 2f
will match all terms within an edit distance of 2
from the
query term. Edit distances specified in this way may not be fractional.
prefixLength
- length of common (non-fuzzy) prefixmaxExpansions
- the maximum number of terms to match. If this number is
greater than BooleanQuery.getMaxClauseCount()
when the query is rewritten,
then the maxClauseCount will be used instead.IllegalArgumentException
- if minimumSimilarity is >= 1 or < 0
or if prefixLength < 0public SlowFuzzyQuery(Term term, float minimumSimilarity, int prefixLength)
public SlowFuzzyQuery(Term term, float minimumSimilarity)
public SlowFuzzyQuery(Term term)
public float getMinSimilarity()
public int getPrefixLength()
protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException
getTermsEnum
in class MultiTermQuery
IOException
public Term getTerm()
public int hashCode()
hashCode
in class MultiTermQuery
public boolean equals(Object obj)
equals
in class MultiTermQuery
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.