public class NearSpansOrdered extends ConjunctionSpans
The formed spans only contains minimum slop matches.
The matching slop is computed from the distance(s) between
the non overlapping matching Spans.
Successive matches are always formed from the successive Spans
of the SpanNearQuery.
The formed spans may contain overlaps when the slop is at least 1. For example, when querying using
t1 t2 t3with slop at least 1, the fragment:
t1 t2 t1 t3 t2 t3matches twice:
t1 t2 .. t3
t1 .. t2 t3Expert: Only public for subclassing. Most implementations should not need this class
| Modifier and Type | Field and Description |
|---|---|
private int |
allowedSlop |
protected int |
matchEnd |
protected int |
matchStart |
protected int |
matchWidth |
atFirstInCurrentDoc, conjunction, oneExhaustedInCurrentDoc, subSpansNO_MORE_POSITIONSNO_MORE_DOCS| Constructor and Description |
|---|
NearSpansOrdered(int allowedSlop,
java.util.List<Spans> subSpans) |
| Modifier and Type | Method and Description |
|---|---|
private static int |
advancePosition(Spans spans,
int position) |
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. |
int |
nextStartPosition()
Returns the next start position for the current doc.
|
int |
startPosition()
Returns the start position in the current doc, or -1 when
Spans.nextStartPosition() was not yet called on the current doc. |
private boolean |
stretchToOrder()
Order the subSpans within the same document by using nextStartPosition on all subSpans
after the first as little as necessary.
|
(package private) boolean |
twoPhaseCurrentDocMatches() |
private boolean |
unpositioned() |
int |
width()
Return the width of the match, which is typically used to sloppy freq.
|
advance, asTwoPhaseIterator, cost, docID, getSubSpans, nextDoc, positionsCost, toMatchDocdoCurrentSpans, doStartCurrentDoc, toStringall, empty, range, slowAdvanceprotected int matchStart
protected int matchEnd
protected int matchWidth
private final int allowedSlop
public NearSpansOrdered(int allowedSlop,
java.util.List<Spans> subSpans)
throws java.io.IOException
java.io.IOExceptionboolean twoPhaseCurrentDocMatches()
throws java.io.IOException
twoPhaseCurrentDocMatches in class ConjunctionSpansjava.io.IOExceptionprivate boolean unpositioned()
public int nextStartPosition()
throws java.io.IOException
SpansSpans.NO_MORE_POSITIONS.nextStartPosition in class Spansjava.io.IOExceptionprivate boolean stretchToOrder()
throws java.io.IOException
java.io.IOExceptionprivate static int advancePosition(Spans spans, int position) throws java.io.IOException
java.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()
Spanspublic void collect(SpanCollector collector) throws java.io.IOException
SpansSpans.nextStartPosition(), and before
Spans.NO_MORE_POSITIONS has been reached.