Package org.apache.lucene.sandbox.search
Class PhraseWildcardQuery.PhraseTerm
java.lang.Object
org.apache.lucene.sandbox.search.PhraseWildcardQuery.PhraseTerm
- Direct Known Subclasses:
PhraseWildcardQuery.MultiTerm,PhraseWildcardQuery.SingleTerm
- Enclosing class:
PhraseWildcardQuery
All
PhraseWildcardQuery.PhraseTerm are light and immutable. They do not hold query processing data such as
PhraseWildcardQuery.TermsData. That way, the PhraseWildcardQuery is immutable and light itself and
can be used safely as a key of the query cache.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intcollectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, int remainingMultiTerms, int maxExpansionsForTerm, PhraseWildcardQuery.TermsData termsData) CollectsTermStateandTermStatisticsfor the term (potentially expanded).protected intcollectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, PhraseWildcardQuery.TermsData termsData) CollectsTermStateandTermStatisticsfor the term without expansion.abstract booleanprotected abstract QuerygetQuery()protected abstract booleanabstract inthashCode()protected abstract voidtoString(StringBuilder builder)
-
Field Details
-
termPosition
protected final int termPosition
-
-
Constructor Details
-
PhraseTerm
protected PhraseTerm(int termPosition)
-
-
Method Details
-
hasExpansions
protected abstract boolean hasExpansions() -
getQuery
-
collectTermData
protected int collectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, PhraseWildcardQuery.TermsData termsData) throws IOException CollectsTermStateandTermStatisticsfor the term without expansion. It must be called only ifhasExpansions()returns false. Simplified version of#collectTermData(PhraseWildcardQuery, IndexSearcher, List, int, int, TermsData)with less arguments. This method throwsUnsupportedOperationExceptionif not overridden.- Throws:
IOException
-
collectTermData
protected abstract int collectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, int remainingMultiTerms, int maxExpansionsForTerm, PhraseWildcardQuery.TermsData termsData) throws IOException CollectsTermStateandTermStatisticsfor the term (potentially expanded).- Parameters:
termsData-PhraseWildcardQuery.TermsDatato update with the collected terms and stats.- Returns:
- The number of expansions or matches in all segments; or 0 if this term does not match in any segment, in this case the phrase query can immediately stop.
- Throws:
IOException
-
toString
-
equals
-
hashCode
public abstract int hashCode()
-