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
protected abstract static class PhraseWildcardQuery.PhraseTerm extends Object
AllPhraseWildcardQuery.PhraseTermare light and immutable. They do not hold query processing data such asPhraseWildcardQuery.TermsData. That way, thePhraseWildcardQueryis 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 inttermPosition
-
Constructor Summary
Constructors Modifier Constructor Description protectedPhraseTerm(int termPosition)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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 booleanequals(Object o)protected abstract QuerygetQuery()protected abstract booleanhasExpansions()abstract inthashCode()protected abstract voidtoString(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
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
protected abstract void toString(StringBuilder builder)
-
-