@Override public void setScorer(Scorer scorer) { //System.out.println("C.setScorer scorer=" + scorer); // Since we invoke .score(), and the comparators likely // do as well, cache it so it's only "really" computed // once: this.scorer = new ScoreCachingWrappingScorer(scorer); for (int compIDX = 0; compIDX < comparators.length; compIDX++) { comparators[compIDX].setScorer(this.scorer); } Arrays.fill(joinScorers, null); Queue<Scorer> queue = new LinkedList<Scorer>(); queue.add(scorer); while ((scorer = queue.poll()) != null) { if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) { enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer); } for (ChildScorer sub : scorer.getChildren()) { queue.add(sub.child); } } }
@Override public void setScorer(Scorer s) { // Gathers all scorers, including s and "under": allScorers = new ArrayList<>(); allScorers.add(s); int upto = 0; while(upto < allScorers.size()) { s = allScorers.get(upto++); for (ChildScorer sub : s.getChildren()) { allScorers.add(sub.child); } } }
@Override public void setScorer(Scorer scorer) { //System.out.println("C.setScorer scorer=" + scorer); // Since we invoke .score(), and the comparators likely // do as well, cache it so it's only "really" computed // once: this.scorer = new ScoreCachingWrappingScorer(scorer); for (int compIDX = 0; compIDX < comparators.length; compIDX++) { comparators[compIDX].setScorer(this.scorer); } Arrays.fill(joinScorers, null); Queue<Scorer> queue = new LinkedList<>(); //System.out.println("\nqueue: add top scorer=" + scorer); queue.add(scorer); while ((scorer = queue.poll()) != null) { //System.out.println(" poll: " + scorer + "; " + scorer.getWeight().getQuery()); if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) { enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer); } for (ChildScorer sub : scorer.getChildren()) { //System.out.println(" add sub: " + sub.child + "; " + sub.child.getWeight().getQuery()); queue.add(sub.child); } } }
private void fillLeaves(Scorer scorer, Set<Scorer> set) { if (scorer.getWeight().getQuery() instanceof TermQuery) { set.add(scorer); } else { for (ChildScorer child : scorer.getChildren()) { fillLeaves(child.child, set); } } }
private static void summarizeScorer(final StringBuilder builder, final Scorer scorer, final int indent) { builder.append(scorer.getClass().getSimpleName()); if (scorer instanceof TermScorer) { TermQuery termQuery = (TermQuery) scorer.getWeight().getQuery(); builder.append(" ").append(termQuery.getTerm().field()).append(":").append(termQuery.getTerm().text()); } for (final ChildScorer childScorer : scorer.getChildren()) { indent(builder, indent + 1).append(childScorer.relationship).append(" "); summarizeScorer(builder, childScorer.child, indent + 2); } }
public void setSubScorers(Scorer scorer, String relationship) { for (ChildScorer child : scorer.getChildren()) { if (scorer instanceof AssertingScorer || relationships.contains(child.relationship)) { setSubScorers(child.child, child.relationship); } } subScorers.put(scorer.getWeight().getQuery(), scorer); }
public void setSubScorers(Scorer scorer, String relationship) { for (ChildScorer child : scorer.getChildren()) { if (relationships.contains(child.relationship)) { setSubScorers(child.child, child.relationship); } } subScorers.put(scorer.getWeight().getQuery(), scorer); }
@Override public void setScorer(Scorer scorer) { //System.out.println("C.setScorer scorer=" + scorer); // Since we invoke .score(), and the comparators likely // do as well, cache it so it's only "really" computed // once: this.scorer = new ScoreCachingWrappingScorer(scorer); for (int compIDX = 0; compIDX < comparators.length; compIDX++) { comparators[compIDX].setScorer(this.scorer); } Arrays.fill(joinScorers, null); Queue<Scorer> queue = new LinkedList<Scorer>(); //System.out.println("\nqueue: add top scorer=" + scorer); queue.add(scorer); while ((scorer = queue.poll()) != null) { //System.out.println(" poll: " + scorer + "; " + scorer.getWeight().getQuery()); if (scorer instanceof ToParentBlockJoinQuery.BlockJoinScorer) { enroll((ToParentBlockJoinQuery) scorer.getWeight().getQuery(), (ToParentBlockJoinQuery.BlockJoinScorer) scorer); } for (ChildScorer sub : scorer.getChildren()) { //System.out.println(" add sub: " + sub.child + "; " + sub.child.getWeight().getQuery()); queue.add(sub.child); } } }
private void findScorers(Scorer scorer) { Integer index = weightToIndex.get(scorer.getWeight()); if (index != null) { if (index.intValue() == -1) { mainScorer = scorer; } else { subScorers[index] = scorer; } } for(ChildScorer child : scorer.getChildren()) { findScorers(child.child); } }
@Override public void setScorer(Scorer s) { // Gathers all scorers, including s and "under": allScorers = new ArrayList<Scorer>(); allScorers.add(s); int upto = 0; while(upto < allScorers.size()) { s = allScorers.get(upto++); for (ChildScorer sub : s.getChildren()) { allScorers.add(sub.child); } } }
@Override public Collection<ChildScorer> getChildren() { return Collections.singleton(new ChildScorer(in, "BOOSTED")); }
@Override public Collection<ChildScorer> getChildren() { return Collections.singleton(new ChildScorer(parentScorer, "BLOCK_JOIN")); }