| java.lang.Object org.apache.lucene.search.Query org.apache.lucene.search.MultiTermQuery org.apache.lucene.search.FuzzyQuery
FuzzyQuery | public class FuzzyQuery extends MultiTermQuery (Code) | | Implements the fuzzy search query. The similiarity measurement
is based on the Levenshtein (edit distance) algorithm.
|
Inner Class :protected static class ScoreTerm | |
Inner Class :protected static class ScoreTermQueue extends PriorityQueue | |
Constructor Summary | |
public | FuzzyQuery(Term term, float minimumSimilarity, int prefixLength) Create a new FuzzyQuery that will match terms with a similarity
of at least 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 Parameters: minimumSimilarity - a value between 0 and 1 to set the required similaritybetween the query term and the matching terms. | public | FuzzyQuery(Term term, float minimumSimilarity) Calls
FuzzyQuery.FuzzyQuery(Term,float) FuzzyQuery(term, minimumSimilarity, 0) . | public | FuzzyQuery(Term term) Calls
FuzzyQuery.FuzzyQuery(Term,float) FuzzyQuery(term, 0.5f, 0) . |
defaultMinSimilarity | final public static float defaultMinSimilarity(Code) | | |
defaultPrefixLength | final public static int defaultPrefixLength(Code) | | |
FuzzyQuery | public FuzzyQuery(Term term, float minimumSimilarity, int prefixLength) throws IllegalArgumentException(Code) | | Create a new FuzzyQuery that will match terms with a similarity
of at least 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 Parameters: minimumSimilarity - a value between 0 and 1 to set the required similaritybetween the query term and the matching terms. For example, for aminimumSimilarity of 0.5 a term of the same lengthas the query term is considered similar to the query term if the edit distancebetween both terms is less than length(term)*0.5 Parameters: prefixLength - length of common (non-fuzzy) prefix throws: IllegalArgumentException - if minimumSimilarity is >= 1 or < 0or if prefixLength < 0 |
getMinSimilarity | public float getMinSimilarity()(Code) | | Returns the minimum similarity that is required for this query to match.
float value between 0.0 and 1.0 |
getPrefixLength | public int getPrefixLength()(Code) | | Returns the non-fuzzy prefix length. This is the number of characters at the start
of a term that must be identical (not fuzzy) to the query term if the query
is to match that term.
|
hashCode | public int hashCode()(Code) | | |
|
|