public class NGramPhraseQuery extends PhraseQuery
PhraseQuerywhich is optimized for n-gram phrase query. For example, when you query "ABCD" on a 2-gram field, you may want to use NGramPhraseQuery rather than
PhraseQuery, because NGramPhraseQuery will
rewrite(IndexReader)the query to "AB/0 CD/2", while
PhraseQuerywill query "AB/0 BC/1 CD/2" (where term/position).
|Constructor and Description|
Constructor that takes gram size.
|Modifier and Type||Method and Description|
Returns true iff
Returns a hash code value for this object.
Expert: called to re-write queries into primitive queries.
add, add, createWeight, extractTerms, getPositions, getSlop, getTerms, setSlop, toString
clone, combine, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
public NGramPhraseQuery(int n)
public Query rewrite(IndexReader reader) throws IOException
public boolean equals(Object o)
ois equal to this.