@Override public float scoreInNode() throws IOException { float score = 0.0f; // Sum the score of the sub-spans for (int i = 0; i < subSpans.length; i++) { score += subSpans[i].scoreInNode(); } // compute the sloppy weight float sloppyWeight = this.sloppyWeight(this.getSlop()); return score * sloppyWeight; }
@Override public boolean nextNode() throws IOException { firstTime = true; return super.nextNode(); }
@Override public boolean skipToCandidate(final int target) throws IOException { // reset matchNode, matchStart and matchEnd this.resetMatchNode(); this.resetStartAndEnd(); // Advance all the spans to or after the target for (int i = 0; i < subSpans.length; i++) { if (!subSpans[i].skipToCandidate(target)) { matchDoc = DocsAndNodesIterator.NO_MORE_DOC; return false; } } // Ensure that all the spans are on the same candidate return toSameCandidateDocument(); }
@Override public boolean nextNode() throws IOException { // reset matchStart and matchEnd this.resetStartAndEnd(); // Advance all the spans to their next node for (int i = 0; i < subSpans.length; i++) { if (!subSpans[i].nextNode()) { matchNode = DocsAndNodesIterator.NO_MORE_NOD; return false; } } // Ensure that all the spans are on the same node return toSameNode(); }
@Override protected final boolean lessThan(final Spans spans1, final Spans spans2) { return isSpansOrdered(spans1.start(), spans1.end(), spans2.start(), spans2.end()); }
@Override public boolean nextCandidateDocument() throws IOException { // reset matchNode, matchStart and matchEnd this.resetMatchNode(); this.resetStartAndEnd(); // Advance all the spans to their next candidate for (int i = 0; i < subSpans.length; i++) { if (!subSpans[i].nextCandidateDocument()) { matchDoc = DocsAndNodesIterator.NO_MORE_DOC; return false; } } // Ensure that all the spans are on the same candidate return toSameCandidateDocument(); }