Package org.apache.lucene.search
Class PhraseWildcardQuery.PhraseTerm
- java.lang.Object
-
- org.apache.lucene.search.PhraseWildcardQuery.PhraseTerm
-
- Direct Known Subclasses:
PhraseWildcardQuery.MultiTerm
,PhraseWildcardQuery.SingleTerm
- Enclosing class:
- PhraseWildcardQuery
protected abstract static class PhraseWildcardQuery.PhraseTerm extends Object
AllPhraseWildcardQuery.PhraseTerm
are light and immutable. They do not hold query processing data such asPhraseWildcardQuery.TermsData
. That way, thePhraseWildcardQuery
is immutable and light itself and can be used safely as a key of the query cache.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
termPosition
-
Constructor Summary
Constructors Modifier Constructor Description protected
PhraseTerm(int termPosition)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
collectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, int remainingMultiTerms, int maxExpansionsForTerm, PhraseWildcardQuery.TermsData termsData)
CollectsTermState
andTermStatistics
for the term (potentially expanded).protected int
collectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, PhraseWildcardQuery.TermsData termsData)
CollectsTermState
andTermStatistics
for the term without expansion.abstract boolean
equals(Object o)
protected abstract Query
getQuery()
protected abstract boolean
hasExpansions()
abstract int
hashCode()
protected abstract void
toString(StringBuilder builder)
-
-
-
Method Detail
-
hasExpansions
protected abstract boolean hasExpansions()
-
getQuery
protected abstract Query getQuery()
-
collectTermData
protected int collectTermData(PhraseWildcardQuery query, IndexSearcher searcher, List<LeafReaderContext> segments, PhraseWildcardQuery.TermsData termsData) throws IOException
CollectsTermState
andTermStatistics
for 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 throwsUnsupportedOperationException
if 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
CollectsTermState
andTermStatistics
for the term (potentially expanded).- Parameters:
termsData
-PhraseWildcardQuery.TermsData
to 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
protected abstract void toString(StringBuilder builder)
-
-