@Override public TwoPhaseIterator asTwoPhaseIterator() { float sumMatchCost = 0; // See also DisjunctionScorer.asTwoPhaseIterator() long sumApproxCost = 0; for (DisiWrapper w : byDocQueue) { if (w.twoPhaseView != null) { long costWeight = (w.cost <= 1) ? 1 : w.cost; sumMatchCost += w.twoPhaseView.matchCost() * costWeight; sumApproxCost += costWeight; } } if (sumApproxCost == 0) { // no sub spans supports approximations computePositionsCost(); return null; } final float matchCost = sumMatchCost / sumApproxCost; return new TwoPhaseIterator(new DisjunctionDISIApproximation(byDocQueue)) { @Override public boolean matches() throws IOException { return twoPhaseCurrentDocMatches(); } @Override public float matchCost() { return matchCost; } }; }
this.approximation = new DisjunctionDISIApproximation(this.subScorers);
@Override public TwoPhaseIterator asTwoPhaseIterator() { float sumMatchCost = 0; // See also DisjunctionScorer.asTwoPhaseIterator() long sumApproxCost = 0; for (DisiWrapper w : byDocQueue) { if (w.twoPhaseView != null) { long costWeight = (w.cost <= 1) ? 1 : w.cost; sumMatchCost += w.twoPhaseView.matchCost() * costWeight; sumApproxCost += costWeight; } } if (sumApproxCost == 0) { // no sub spans supports approximations computePositionsCost(); return null; } final float matchCost = sumMatchCost / sumApproxCost; return new TwoPhaseIterator(new DisjunctionDISIApproximation(byDocQueue)) { @Override public boolean matches() throws IOException { return twoPhaseCurrentDocMatches(); } @Override public float matchCost() { return matchCost; } }; }
@Override public TwoPhaseIterator asTwoPhaseIterator() { float sumMatchCost = 0; // See also DisjunctionScorer.asTwoPhaseIterator() long sumApproxCost = 0; for (DisiWrapper w : byDocQueue) { if (w.twoPhaseView != null) { long costWeight = (w.cost <= 1) ? 1 : w.cost; sumMatchCost += w.twoPhaseView.matchCost() * costWeight; sumApproxCost += costWeight; } } if (sumApproxCost == 0) { // no sub spans supports approximations computePositionsCost(); return null; } final float matchCost = sumMatchCost / sumApproxCost; return new TwoPhaseIterator(new DisjunctionDISIApproximation(byDocQueue)) { @Override public boolean matches() throws IOException { return twoPhaseCurrentDocMatches(); } @Override public float matchCost() { return matchCost; } }; }
@Override public TwoPhaseIterator asTwoPhaseIterator() { float sumMatchCost = 0; // See also DisjunctionScorer.asTwoPhaseIterator() long sumApproxCost = 0; for (DisiWrapper w : byDocQueue) { if (w.twoPhaseView != null) { long costWeight = (w.cost <= 1) ? 1 : w.cost; sumMatchCost += w.twoPhaseView.matchCost() * costWeight; sumApproxCost += costWeight; } } if (sumApproxCost == 0) { // no sub spans supports approximations computePositionsCost(); return null; } final float matchCost = sumMatchCost / sumApproxCost; return new TwoPhaseIterator(new DisjunctionDISIApproximation(byDocQueue)) { @Override public boolean matches() throws IOException { return twoPhaseCurrentDocMatches(); } @Override public float matchCost() { return matchCost; } }; }
@Override public TwoPhaseIterator asTwoPhaseIterator() { float sumMatchCost = 0; // See also DisjunctionScorer.asTwoPhaseIterator() long sumApproxCost = 0; for (DisiWrapper w: byDocQueue) { if (w.twoPhaseView != null) { long costWeight = (w.cost <= 1) ? 1 : w.cost; sumMatchCost += w.twoPhaseView.matchCost() * costWeight; sumApproxCost += costWeight; } } if (sumApproxCost == 0) { // no sub spans supports approximations computePositionsCost(); return null; } final float matchCost = sumMatchCost / sumApproxCost; return new TwoPhaseIterator(new DisjunctionDISIApproximation(byDocQueue)) { @Override public boolean matches() throws IOException { return twoPhaseCurrentDocMatches(); } @Override public float matchCost() { return matchCost; } }; }
this.approximation = new DisjunctionDISIApproximation(this.subScorers);
this.approximation = new DisjunctionDISIApproximation(this.subScorers);
this.approximation = new DisjunctionDISIApproximation(this.subScorers);