public class FuzzyLikeThisQuery extends Query
Modifier and Type | Class and Description |
---|---|
(package private) static class |
FuzzyLikeThisQuery.FieldVals |
private static class |
FuzzyLikeThisQuery.ScoreTerm |
private static class |
FuzzyLikeThisQuery.ScoreTermQueue |
Modifier and Type | Field and Description |
---|---|
(package private) Analyzer |
analyzer |
(package private) java.util.ArrayList<FuzzyLikeThisQuery.FieldVals> |
fieldVals |
(package private) boolean |
ignoreTF |
(package private) int |
MAX_VARIANTS_PER_TERM |
private int |
maxNumTerms |
(package private) static TFIDFSimilarity |
sim |
Constructor and Description |
---|
FuzzyLikeThisQuery(int maxNumTerms,
Analyzer analyzer) |
Modifier and Type | Method and Description |
---|---|
private void |
addTerms(IndexReader reader,
FuzzyLikeThisQuery.FieldVals f,
FuzzyLikeThisQuery.ScoreTermQueue q) |
void |
addTerms(java.lang.String queryString,
java.lang.String fieldName,
float minSimilarity,
int prefixLength)
Adds user input for "fuzzification"
|
boolean |
equals(java.lang.Object other)
Override and implement query instance equivalence properly in a subclass.
|
private boolean |
equalsTo(FuzzyLikeThisQuery other) |
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
boolean |
isIgnoreTF() |
private Query |
newTermQuery(IndexReader reader,
Term term) |
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
void |
setIgnoreTF(boolean ignoreTF) |
java.lang.String |
toString(java.lang.String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
void |
visit(QueryVisitor visitor)
Recurse through the query tree, visiting any child queries
|
classHash, createWeight, sameClassAs, toString
static TFIDFSimilarity sim
java.util.ArrayList<FuzzyLikeThisQuery.FieldVals> fieldVals
Analyzer analyzer
int MAX_VARIANTS_PER_TERM
boolean ignoreTF
private int maxNumTerms
public FuzzyLikeThisQuery(int maxNumTerms, Analyzer analyzer)
maxNumTerms
- The total number of terms clauses that will appear once rewritten as a BooleanQuerypublic int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
public boolean equals(java.lang.Object other)
Query
QueryCache
works properly.
Typically a query will be equal to another only if it's an instance of
the same class and its document-filtering properties are identical that other
instance. Utility methods are provided for certain repetitive code.equals
in class Query
Query.sameClassAs(Object)
,
Query.classHash()
private boolean equalsTo(FuzzyLikeThisQuery other)
public void addTerms(java.lang.String queryString, java.lang.String fieldName, float minSimilarity, int prefixLength)
queryString
- The string which will be parsed by the analyzer and for which fuzzy variants will be parsedminSimilarity
- The minimum similarity of the term variants; must be 0, 1 or 2 (see FuzzyTermsEnum)prefixLength
- Length of required common prefix on variant terms (see FuzzyTermsEnum)private void addTerms(IndexReader reader, FuzzyLikeThisQuery.FieldVals f, FuzzyLikeThisQuery.ScoreTermQueue q) throws java.io.IOException
java.io.IOException
private Query newTermQuery(IndexReader reader, Term term) throws java.io.IOException
java.io.IOException
public void visit(QueryVisitor visitor)
Query
public Query rewrite(IndexReader reader) throws java.io.IOException
Query
public java.lang.String toString(java.lang.String field)
Query
field
assumed to be the
default field and omitted.public boolean isIgnoreTF()
public void setIgnoreTF(boolean ignoreTF)