BulkScorer optionalBulkScorer(LeafReaderContext context) throws IOException { List<BulkScorer> optional = new ArrayList<BulkScorer>(); Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.getOccur() != Occur.SHOULD) { continue; } BulkScorer subScorer = w.bulkScorer(context); if (subScorer != null) { optional.add(subScorer); } } if (optional.size() == 0) { return null; } if (query.getMinimumNumberShouldMatch() > optional.size()) { return null; } if (optional.size() == 1) { return optional.get(0); } return new BooleanScorer(this, optional, Math.max(1, query.getMinimumNumberShouldMatch()), needsScores); }
Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next();
private BulkScorer requiredBulkScorer(LeafReaderContext context) throws IOException { BulkScorer scorer = null; Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.isRequired() == false) { continue; } if (scorer != null) { // we don't have a BulkScorer for conjunctions return null; } scorer = w.bulkScorer(context); if (scorer == null) { // no matches return null; } if (c.isScoring() == false && needsScores) { scorer = disableScoring(scorer); } } return scorer; }
Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next();
int matchCount = 0; int shouldMatchCount = 0; Iterator<BooleanClause> cIter = query.iterator(); for (Iterator<Weight> wIter = weights.iterator(); wIter.hasNext();) { Weight w = wIter.next();
BulkScorer optionalBulkScorer(LeafReaderContext context) throws IOException { List<BulkScorer> optional = new ArrayList<BulkScorer>(); Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.getOccur() != Occur.SHOULD) { continue; } BulkScorer subScorer = w.bulkScorer(context); if (subScorer != null) { optional.add(subScorer); } } if (optional.size() == 0) { return null; } if (query.getMinimumNumberShouldMatch() > optional.size()) { return null; } if (optional.size() == 1) { return optional.get(0); } return new BooleanScorer(this, optional, Math.max(1, query.getMinimumNumberShouldMatch()), needsScores); }
Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next();
BulkScorer optionalBulkScorer(LeafReaderContext context) throws IOException { List<BulkScorer> optional = new ArrayList<BulkScorer>(); Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.getOccur() != Occur.SHOULD) { continue; } BulkScorer subScorer = w.bulkScorer(context); if (subScorer != null) { optional.add(subScorer); } } if (optional.size() == 0) { return null; } if (query.getMinimumNumberShouldMatch() > optional.size()) { return null; } if (optional.size() == 1) { BulkScorer opt = optional.get(0); if (!disableCoord && maxCoord > 1) { return new BooleanTopLevelScorers.BoostedBulkScorer(opt, coord(1, maxCoord)); } else { return opt; } } return new BooleanScorer(this, disableCoord, maxCoord, optional, Math.max(1, query.getMinimumNumberShouldMatch()), needsScores); }
BulkScorer optionalBulkScorer(LeafReaderContext context) throws IOException { List<BulkScorer> optional = new ArrayList<BulkScorer>(); Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.getOccur() != Occur.SHOULD) { continue; } BulkScorer subScorer = w.bulkScorer(context); if (subScorer != null) { optional.add(subScorer); } } if (optional.size() == 0) { return null; } if (query.getMinimumNumberShouldMatch() > optional.size()) { return null; } if (optional.size() == 1) { BulkScorer opt = optional.get(0); if (!disableCoord && maxCoord > 1) { return new BooleanTopLevelScorers.BoostedBulkScorer(opt, coord(1, maxCoord)); } else { return opt; } } return new BooleanScorer(this, disableCoord, maxCoord, optional, Math.max(1, query.getMinimumNumberShouldMatch()), needsScores); }
private BulkScorer requiredBulkScorer(LeafReaderContext context) throws IOException { BulkScorer scorer = null; Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.isRequired() == false) { continue; } if (scorer != null) { // we don't have a BulkScorer for conjunctions return null; } scorer = w.bulkScorer(context); if (scorer == null) { // no matches return null; } if (c.isScoring() == false && needsScores) { scorer = disableScoring(scorer); } } return scorer; }
private BulkScorer requiredBulkScorer(LeafReaderContext context) throws IOException { BulkScorer scorer = null; Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.isRequired() == false) { continue; } if (scorer != null) { // we don't have a BulkScorer for conjunctions return null; } scorer = w.bulkScorer(context); if (scorer == null) { // no matches return null; } if (c.isScoring() == false) { if (needsScores) { scorer = disableScoring(scorer); } } else { assert maxCoord == 1; } } return scorer; }
private BulkScorer requiredBulkScorer(LeafReaderContext context) throws IOException { BulkScorer scorer = null; Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next(); if (c.isRequired() == false) { continue; } if (scorer != null) { // we don't have a BulkScorer for conjunctions return null; } scorer = w.bulkScorer(context); if (scorer == null) { // no matches return null; } if (c.isScoring() == false) { if (needsScores) { scorer = disableScoring(scorer); } } else { assert maxCoord == 1; } } return scorer; }
List<Scorer> prohibited = new ArrayList<>(); List<Scorer> optional = new ArrayList<>(); Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next();
Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next();
int matchCount = 0; int shouldMatchCount = 0; Iterator<BooleanClause> cIter = query.iterator(); for (Iterator<Weight> wIter = weights.iterator(); wIter.hasNext();) { Weight w = wIter.next();
Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next();
Iterator<BooleanClause> cIter = query.iterator(); for (Weight w : weights) { BooleanClause c = cIter.next();
int matchCount = 0; int shouldMatchCount = 0; Iterator<BooleanClause> cIter = query.iterator(); for (Iterator<Weight> wIter = weights.iterator(); wIter.hasNext();) { Weight w = wIter.next();
Iterator<BooleanClause> iterator = bq.iterator(); while(iterator.hasNext())
int matchCount = 0; int shouldMatchCount = 0; Iterator<BooleanClause> cIter = query.iterator(); for (Iterator<Weight> wIter = weights.iterator(); wIter.hasNext();) { Weight w = wIter.next();