org.apache.lucene.search
public class FuzzyQuery extends MultiTermQuery
Nested Class Summary | |
---|---|
protected static class | FuzzyQuery.ScoreTerm |
protected static class | FuzzyQuery.ScoreTermQueue |
Field Summary | |
---|---|
static float | defaultMinSimilarity |
static int | defaultPrefixLength |
Constructor Summary | |
---|---|
FuzzyQuery(Term term, float minimumSimilarity, int prefixLength)
Create a new FuzzyQuery that will match terms with a similarity
of at least minimumSimilarity to term .
| |
FuzzyQuery(Term term, float minimumSimilarity) | |
FuzzyQuery(Term term)
Calls FuzzyQuery(term, 0.5f, 0) . |
Method Summary | |
---|---|
boolean | equals(Object o) |
protected FilteredTermEnum | getEnum(IndexReader reader) |
float | getMinSimilarity()
Returns the minimum similarity that is required for this query to match. |
int | getPrefixLength()
Returns the non-fuzzy prefix length. |
int | hashCode() |
Query | rewrite(IndexReader reader) |
String | toString(String field) |
minimumSimilarity
to term
.
If a prefixLength
> 0 is specified, a common prefix
of that length is also required.
Parameters: term the term to search for minimumSimilarity 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
prefixLength length of common (non-fuzzy) prefix
Throws: IllegalArgumentException if minimumSimilarity is >= 1 or < 0 or if prefixLength < 0
FuzzyQuery(term, 0.5f, 0)
.Returns: float value between 0.0 and 1.0