Module org.apache.lucene.queries
Class TermIntervalsSource
java.lang.Object
org.apache.lucene.queries.intervals.IntervalsSource
org.apache.lucene.queries.intervals.TermIntervalsSource
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BytesRef
private static final int
Number of simple operations inLucene90PostingsReader.EverythingEnum#nextPosition()
when no seek or buffer refill is done.private static final int
A guess of the average number of simple operations for the initial seek and buffer refill per document for the positions of a term. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
intervals
(String field, LeafReaderContext ctx) Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
(package private) static IntervalIterator
matches
(String field, LeafReaderContext ctx, int doc) Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and field(package private) static IntervalMatchesIterator
int
Return the minimum possible width of an interval returned by this sourceExpert: return the set of disjunctions that make up this IntervalsSource(package private) static float
termPositionsCost
(TermsEnum termsEnum) Returns an expected cost in simple operations of processing the occurrences of a term in a document that contains the term.toString()
void
visit
(String field, QueryVisitor visitor) Expert: visit the tree of sources
-
Field Details
-
term
-
TERM_POSNS_SEEK_OPS_PER_DOC
private static final int TERM_POSNS_SEEK_OPS_PER_DOCA guess of the average number of simple operations for the initial seek and buffer refill per document for the positions of a term. See alsoLucene90PostingsReader.EverythingEnum#nextPosition()
.Aside: Instead of being constant this could depend among others on
Lucene90PostingsFormat.BLOCK_SIZE
,TermsEnum.docFreq()
,TermsEnum.totalTermFreq()
,DocIdSetIterator.cost()
(expected number of matching docs),IndexReader.maxDoc()
(total number of docs in the segment), and the seek time and block size of the device storing the index.- See Also:
-
TERM_OPS_PER_POS
private static final int TERM_OPS_PER_POSNumber of simple operations inLucene90PostingsReader.EverythingEnum#nextPosition()
when no seek or buffer refill is done.- See Also:
-
-
Constructor Details
-
TermIntervalsSource
TermIntervalsSource(BytesRef term)
-
-
Method Details
-
intervals
Description copied from class:IntervalsSource
Create anIntervalIterator
exposing the minimum intervals defined by thisIntervalsSource
Returns
null
if no intervals for this field exist in this segment- Specified by:
intervals
in classIntervalsSource
- Parameters:
field
- the field to read positions fromctx
- the context for which to return the iterator- Throws:
IOException
-
intervals
- Throws:
IOException
-
matches
public IntervalMatchesIterator matches(String field, LeafReaderContext ctx, int doc) throws IOException Description copied from class:IntervalsSource
Return aMatchesIterator
over the intervals defined by thisIntervalsSource
for a given document and fieldReturns
null
if no intervals exist in the given document and field- Specified by:
matches
in classIntervalsSource
- Parameters:
field
- the field to read positions fromctx
- the document's contextdoc
- the document to return matches for- Throws:
IOException
-
matches
- Throws:
IOException
-
minExtent
public int minExtent()Description copied from class:IntervalsSource
Return the minimum possible width of an interval returned by this source- Specified by:
minExtent
in classIntervalsSource
-
pullUpDisjunctions
Description copied from class:IntervalsSource
Expert: return the set of disjunctions that make up this IntervalsSourceMost implementations can return
Collections.singleton(this)
- Specified by:
pullUpDisjunctions
in classIntervalsSource
-
hashCode
public int hashCode()- Specified by:
hashCode
in classIntervalsSource
-
equals
- Specified by:
equals
in classIntervalsSource
-
toString
- Specified by:
toString
in classIntervalsSource
-
visit
Description copied from class:IntervalsSource
Expert: visit the tree of sources- Specified by:
visit
in classIntervalsSource
-
termPositionsCost
Returns an expected cost in simple operations of processing the occurrences of a term in a document that contains the term. This is for use byTwoPhaseIterator.matchCost()
implementations.- Parameters:
termsEnum
- The term is the term at which this TermsEnum is positioned.- Throws:
IOException
-