public abstract class Spans extends DocIdSetIterator
Modifier and Type | Field and Description |
---|---|
static int |
NO_MORE_POSITIONS |
NO_MORE_DOCS
Constructor and Description |
---|
Spans() |
Modifier and Type | Method and Description |
---|---|
TwoPhaseIterator |
asTwoPhaseIterator()
Optional method: Return a
TwoPhaseIterator view of this
Scorer . |
abstract void |
collect(SpanCollector collector)
Collect postings data from the leaves of the current Spans.
|
protected void |
doCurrentSpans()
Called each time the scorer's SpanScorer is advanced during frequency calculation
|
protected void |
doStartCurrentDoc()
Called before the current doc's frequency is calculated
|
abstract int |
endPosition()
Returns the end position for the current start position, or -1 when
nextStartPosition() was not yet called on the current doc. |
abstract int |
nextStartPosition()
Returns the next start position for the current doc.
|
abstract float |
positionsCost()
Return an estimation of the cost of using the positions of
this
Spans for any single document, but only after
asTwoPhaseIterator() returned null . |
abstract int |
startPosition()
Returns the start position in the current doc, or -1 when
nextStartPosition() was not yet called on the current doc. |
String |
toString() |
abstract int |
width()
Return the width of the match, which is typically used to compute
the
slop factor . |
advance, all, cost, docID, empty, nextDoc, slowAdvance
public static final int NO_MORE_POSITIONS
public abstract int nextStartPosition() throws IOException
NO_MORE_POSITIONS
.IOException
public abstract int startPosition()
nextStartPosition()
was not yet called on the current doc.
After the last start/end position at the current doc this returns NO_MORE_POSITIONS
.public abstract int endPosition()
nextStartPosition()
was not yet called on the current doc.
After the last start/end position at the current doc this returns NO_MORE_POSITIONS
.public abstract int width()
slop factor
. It is only legal
to call this method when the iterator is on a valid doc ID and positioned.
The return value must be positive, and lower values means that the match is
better.public abstract void collect(SpanCollector collector) throws IOException
nextStartPosition()
, and before
NO_MORE_POSITIONS
has been reached.collector
- a SpanCollectorIOException
public abstract float positionsCost()
Spans
for any single document, but only after
asTwoPhaseIterator()
returned null
.
Otherwise this method should not be called.
The returned value is independent of the current document.public TwoPhaseIterator asTwoPhaseIterator()
TwoPhaseIterator
view of this
Scorer
. A return value of null
indicates that
two-phase iteration is not supported.Scorer.twoPhaseIterator()
protected void doStartCurrentDoc() throws IOException
IOException
protected void doCurrentSpans() throws IOException
IOException
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.