public class NearSpansUnordered extends ConjunctionSpans
NearSpansOrdered
, but for the unordered case.
Expert:
Only public for subclassing. Most implementations should not need this classModifier and Type | Class and Description |
---|---|
private static class |
NearSpansUnordered.SpanPositionQueue |
private class |
NearSpansUnordered.SpansCell |
Modifier and Type | Field and Description |
---|---|
private int |
allowedSlop |
private NearSpansUnordered.SpansCell |
maxEndPositionCell |
private NearSpansUnordered.SpanPositionQueue |
spanPositionQueue |
private java.util.List<NearSpansUnordered.SpansCell> |
subSpanCells |
private int |
totalSpanLength
SpansCell wraps a sub Spans to maintain totalSpanLength and maxEndPositionCell
|
atFirstInCurrentDoc, conjunction, oneExhaustedInCurrentDoc, subSpans
NO_MORE_POSITIONS
NO_MORE_DOCS
Constructor and Description |
---|
NearSpansUnordered(int allowedSlop,
java.util.List<Spans> subSpans) |
Modifier and Type | Method and Description |
---|---|
private boolean |
atMatch() |
void |
collect(SpanCollector collector)
Collect postings data from the leaves of the current Spans.
|
int |
endPosition()
Returns the end position for the current start position, or -1 when
Spans.nextStartPosition() was not yet called on the current doc. |
private NearSpansUnordered.SpansCell |
minPositionCell() |
int |
nextStartPosition()
Returns the next start position for the current doc.
|
(package private) static boolean |
positionsOrdered(Spans spans1,
Spans spans2)
Check whether two Spans in the same document are ordered with possible overlap.
|
private void |
singleCellToPositionQueue() |
int |
startPosition()
Returns the start position in the current doc, or -1 when
Spans.nextStartPosition() was not yet called on the current doc. |
private void |
subSpanCellsToPositionQueue() |
(package private) boolean |
twoPhaseCurrentDocMatches() |
int |
width()
Return the width of the match, which is typically used to compute
the
slop factor . |
advance, asTwoPhaseIterator, cost, docID, getSubSpans, nextDoc, positionsCost, toMatchDoc
doCurrentSpans, doStartCurrentDoc, toString
all, empty, slowAdvance
private java.util.List<NearSpansUnordered.SpansCell> subSpanCells
private final int allowedSlop
private NearSpansUnordered.SpanPositionQueue spanPositionQueue
private int totalSpanLength
private NearSpansUnordered.SpansCell maxEndPositionCell
public NearSpansUnordered(int allowedSlop, java.util.List<Spans> subSpans) throws java.io.IOException
java.io.IOException
private void singleCellToPositionQueue()
private void subSpanCellsToPositionQueue() throws java.io.IOException
java.io.IOException
static boolean positionsOrdered(Spans spans1, Spans spans2)
private NearSpansUnordered.SpansCell minPositionCell()
private boolean atMatch()
boolean twoPhaseCurrentDocMatches() throws java.io.IOException
twoPhaseCurrentDocMatches
in class ConjunctionSpans
java.io.IOException
public int nextStartPosition() throws java.io.IOException
Spans
Spans.NO_MORE_POSITIONS
.nextStartPosition
in class Spans
java.io.IOException
public int startPosition()
Spans
Spans.nextStartPosition()
was not yet called on the current doc.
After the last start/end position at the current doc this returns Spans.NO_MORE_POSITIONS
.startPosition
in class Spans
public int endPosition()
Spans
Spans.nextStartPosition()
was not yet called on the current doc.
After the last start/end position at the current doc this returns Spans.NO_MORE_POSITIONS
.endPosition
in class Spans
public int width()
Spans
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 void collect(SpanCollector collector) throws java.io.IOException
Spans
Spans.nextStartPosition()
, and before
Spans.NO_MORE_POSITIONS
has been reached.