public BoostedWeight(BoostedQuery outerInstance, IndexSearcher searcher) { this.outerInstance = outerInstance; this.searcher = searcher; this.qWeight = outerInstance.q.CreateWeight(searcher); this.fcontext = ValueSource.NewContext(searcher); outerInstance.boostVal.CreateWeight(fcontext, searcher); }
public CustomScorer(BoostedQuery outerInstance, AtomicReaderContext readerContext, BoostedQuery.BoostedWeight w, float qWeight, Scorer scorer, ValueSource vs) : base(w) { this.outerInstance = outerInstance; this.weight = w; this.qWeight = qWeight; this.scorer = scorer; this.readerContext = readerContext; this.vals = vs.GetValues(weight.fcontext, readerContext); }
public virtual void TestBasic() { Query q = new MatchAllDocsQuery(); TopDocs docs = @is.Search(q, 10); assertEquals(1, docs.TotalHits); float score = docs.ScoreDocs[0].Score; Query boostedQ = new BoostedQuery(q, new ConstValueSource(2.0f)); AssertHits(boostedQ, new float[] { score * 2 }); }
public override Query Rewrite(IndexReader reader) { Query newQ = q.Rewrite(reader); if (newQ == q) { return(this); } BoostedQuery bq = (BoostedQuery)this.MemberwiseClone(); bq.q = newQ; return(bq); }
public CustomScorer(BoostedQuery outerInstance, AtomicReaderContext readerContext, BoostedQuery.BoostedWeight w, float qWeight, Scorer scorer, ValueSource vs) : base(w) { this.outerInstance = outerInstance; this.weight = w; this.qWeight = qWeight; this.scorer = scorer; this.readerContext = readerContext; this.vals = vs.GetValues(weight.fcontext, readerContext); }
public BoostedWeight(BoostedQuery outerInstance, IndexSearcher searcher) { this.outerInstance = outerInstance; this.searcher = searcher; this.qWeight = outerInstance.q.CreateWeight(searcher); this.fcontext = ValueSource.NewContext(searcher); outerInstance.boostVal.CreateWeight(fcontext, searcher); }