public class NearSpansUnordered extends ConjunctionSpans
NearSpansOrdered, but for the unordered case.
Expert:
Only public for subclassing. Most implementations should not need this class| Modifier 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, subSpansNO_MORE_POSITIONSNO_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, toMatchDocdoCurrentSpans, doStartCurrentDoc, toStringall, empty, slowAdvanceprivate 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.IOExceptionprivate void singleCellToPositionQueue()
private void subSpanCellsToPositionQueue()
throws java.io.IOException
java.io.IOExceptionstatic boolean positionsOrdered(Spans spans1, Spans spans2)
private NearSpansUnordered.SpansCell minPositionCell()
private boolean atMatch()
boolean twoPhaseCurrentDocMatches()
throws java.io.IOException
twoPhaseCurrentDocMatches in class ConjunctionSpansjava.io.IOExceptionpublic int nextStartPosition()
throws java.io.IOException
SpansSpans.NO_MORE_POSITIONS.nextStartPosition in class Spansjava.io.IOExceptionpublic int startPosition()
SpansSpans.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 Spanspublic int endPosition()
SpansSpans.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 Spanspublic int width()
Spansslop 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
SpansSpans.nextStartPosition(), and before
Spans.NO_MORE_POSITIONS has been reached.