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 sloppy freq.
|
advance, all, cost, docID, empty, nextDoc, range, 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()
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-2021 Apache Software Foundation. All Rights Reserved.