@Override public float scoreInNode() throws IOException { final float nodeScore = super.scoreInNode(); coordinator.nrMatchers += super.nrMatchers(); return nodeScore; }
private NodeScorer countingDisjunctionSumScorer(final List<NodeScorer> scorers) throws IOException { return new NodeDisjunctionScorer(this.getWeight(), scorers) { @Override public float scoreInNode() throws IOException { final float nodeScore = super.scoreInNode(); coordinator.nrMatchers += super.nrMatchers(); return nodeScore; } }; }
@Override public float freqInNode() throws IOException { if (currentDoc == -1) { // if nextCandidateDocument not called for the first time return 0; } // return the number of matchers in the node return this.nrMatchers(); }
/** * Construct a {@link NodeDisjunctionScorer}. * * @param subScorers * A collection of at least two primitives scorers. * @throws IOException */ public NodeDisjunctionScorer(final Weight weight, final List<NodeScorer> scorers) throws IOException { super(weight); nrScorers = scorers.size(); if (nrScorers <= 1) { throw new IllegalArgumentException("There must be at least 2 subScorers"); } this.scorers = scorers; nodeScorerQueue = this.initNodeScorerQueue(); }
/** * 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))); }