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
Spans . |
abstract void |
collect(SpanCollector collector)
Collect postings data from the leaves of the current Spans.
|
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 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 TwoPhaseIterator asTwoPhaseIterator()
TwoPhaseIterator
view of this
Spans
. A return value of null
indicates that
two-phase iteration is not supported.
Note that the returned TwoPhaseIterator
's
approximation
must
advance documents synchronously with this iterator:
advancing the approximation must
advance this iterator and vice-versa.
Implementing this method is typically useful on a Spans
that has a high per-document overhead for confirming matches.
The default implementation returns null
.Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.