protected AugmentScorer(BoboSegmentReader reader, Scorer innerScorer, ScoreAugmentFunction func, JSONObject jsonParms) throws IOException { super(innerScorer.getWeight()); _innerScorer = innerScorer; _func = func; _func.initializeReader(reader, jsonParms); }
public FacetBasedBoostingScorer(BoboSegmentReader reader, Scorer innerScorer) { super(innerScorer.getWeight()); _innerScorer = innerScorer; ArrayList<BoboDocScorer> list = new ArrayList<BoboDocScorer>(); for (Map.Entry<String, Map<String, Float>> boostEntry : _boostMaps.entrySet()) { String facetName = boostEntry.getKey(); FacetHandler<?> handler = reader.getFacetHandler(facetName); if (!(handler instanceof FacetScoreable)) throw new IllegalArgumentException(facetName + " does not implement FacetScoreable"); FacetScoreable facetScoreable = (FacetScoreable) handler; BoboDocScorer scorer = facetScoreable.getDocScorer(reader, _scoringFunctionFactory, boostEntry.getValue()); if (scorer != null) list.add(scorer); } _facetScorers = list.toArray(new BoboDocScorer[list.size()]); _docid = -1; }
@Override public void setScorer(Scorer scorer) throws IOException { //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: if (scorer instanceof ScoreCachingWrappingScorer == false) { scorer = new ScoreCachingWrappingScorer(scorer); } this.scorer = scorer; for (LeafFieldComparator comparator : comparators) { comparator.setScorer(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); } } }
public CustomScorer(Scorer innerScorer, BoboSegmentReader boboReader, CustomMathModel cModel, DataTable _dt, JSONObject _valueJson) throws Exception { super(innerScorer.getWeight()); _innerScorer = innerScorer; _sModifier = new RuntimeRelevanceFunction(cModel, _dt); _sModifier.initializeGlobal(_valueJson); _sModifier.initializeReader(boboReader, _valueJson); }
final BigSegmentedArray orderArray = facetDataCache.orderArray; final TermLongList termList = (TermLongList) facetDataCache.valArray; return new Scorer(innerScorer.getWeight()) {