class TermIntervalsSource extends IntervalsSource
Modifier and Type | Field and Description |
---|---|
(package private) BytesRef |
term |
private static int |
TERM_OPS_PER_POS
Number of simple operations in
Lucene50PostingsReader.BlockPostingsEnum#nextPosition()
when no seek or buffer refill is done. |
private static int |
TERM_POSNS_SEEK_OPS_PER_DOC
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 and Description |
---|
TermIntervalsSource(BytesRef term) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
(package private) static IntervalIterator |
intervals(BytesRef term,
TermsEnum te) |
IntervalIterator |
intervals(java.lang.String field,
LeafReaderContext ctx)
Create an
IntervalIterator exposing the minimum intervals defined by this IntervalsSource
Returns null if no intervals for this field exist in this segment |
MatchesIterator |
matches(java.lang.String field,
LeafReaderContext ctx,
int doc)
Return a
MatchesIterator over the intervals defined by this IntervalsSource for a
given document and field
Returns null if no intervals exist in the given document and field |
(package private) static MatchesIterator |
matches(TermsEnum te,
int doc) |
int |
minExtent()
Return the minimum possible width of an interval returned by this source
|
java.util.Collection<IntervalsSource> |
pullUpDisjunctions()
Expert: return the set of disjunctions that make up this IntervalsSource
Most implementations can return
Collections.singleton(this) |
(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.
|
java.lang.String |
toString() |
void |
visit(java.lang.String field,
QueryVisitor visitor)
Expert: visit the tree of sources
|
final BytesRef term
private static final int TERM_POSNS_SEEK_OPS_PER_DOC
Lucene50PostingsReader.BlockPostingsEnum#nextPosition()
.
Aside: Instead of being constant this could depend among others on
Lucene50PostingsFormat.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.
private static final int TERM_OPS_PER_POS
Lucene50PostingsReader.BlockPostingsEnum#nextPosition()
when no seek or buffer refill is done.TermIntervalsSource(BytesRef term)
public IntervalIterator intervals(java.lang.String field, LeafReaderContext ctx) throws java.io.IOException
IntervalsSource
IntervalIterator
exposing the minimum intervals defined by this IntervalsSource
Returns null
if no intervals for this field exist in this segmentintervals
in class IntervalsSource
field
- the field to read positions fromctx
- the context for which to return the iteratorjava.io.IOException
static IntervalIterator intervals(BytesRef term, TermsEnum te) throws java.io.IOException
java.io.IOException
public MatchesIterator matches(java.lang.String field, LeafReaderContext ctx, int doc) throws java.io.IOException
IntervalsSource
MatchesIterator
over the intervals defined by this IntervalsSource
for a
given document and field
Returns null
if no intervals exist in the given document and fieldmatches
in class IntervalsSource
field
- the field to read positions fromctx
- the document's contextdoc
- the document to return matches forjava.io.IOException
static MatchesIterator matches(TermsEnum te, int doc) throws java.io.IOException
java.io.IOException
public int minExtent()
IntervalsSource
minExtent
in class IntervalsSource
public java.util.Collection<IntervalsSource> pullUpDisjunctions()
IntervalsSource
Collections.singleton(this)
pullUpDisjunctions
in class IntervalsSource
public int hashCode()
hashCode
in class IntervalsSource
public boolean equals(java.lang.Object o)
equals
in class IntervalsSource
public java.lang.String toString()
toString
in class IntervalsSource
public void visit(java.lang.String field, QueryVisitor visitor)
IntervalsSource
visit
in class IntervalsSource
static float termPositionsCost(TermsEnum termsEnum) throws java.io.IOException
TwoPhaseIterator.matchCost()
implementations.termsEnum
- The term is the term at which this TermsEnum is positioned.java.io.IOException