@Override public boolean nextCandidateDocument() throws IOException { if (!reqScorer.nextCandidateDocument()) { return false; } if (exclScorer == null) { return true; // reqScorer.nextCandidateDocument() already returned true } return this.toNonExcludedCandidateDocument(); }
/** * Returns the scorer to be used for match counting and score summing. Uses * the given required scorer and the prohibitedScorers. * * @param requiredCountingSumScorer * A required scorer already built. */ private NodeScorer addProhibitedScorers(final NodeScorer requiredCountingSumScorer) throws IOException { return (prohibitedScorers.size() == 0) ? requiredCountingSumScorer // no prohibited : new NodeReqExclScorer(requiredCountingSumScorer, ((prohibitedScorers.size() == 1) ? prohibitedScorers.get(0) : new NodeDisjunctionScorer(weight, prohibitedScorers))); }
@Override public boolean nextNode() throws IOException { if (!reqScorer.nextNode()) { // Move to the next matching node return false; // exhausted, nothing left } if (exclScorer == null || exclScorer.doc() != reqScorer.doc()) { return true; // reqScorer.nextNode() already returned true } // reqScorer and exclScorer are positioned on the same candidate document return this.toNonExcludedNode(); }
@Override public boolean skipToCandidate(final int target) throws IOException { if (exclScorer == null) { return reqScorer.skipToCandidate(target); } if (!reqScorer.skipToCandidate(target)) { return false; } return this.toNonExcludedCandidateDocument(); }