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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
protected abstract Query
getQuery()
protected abstract boolean
abstract int
hashCode()
protected abstract void
toString
(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 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
-
equals
-
hashCode
public abstract int hashCode()
-