/* Create the scorer used to score our associated DisjunctionMaxQuery */ public virtual Scorer Scorer(IndexReader reader) { DisjunctionMaxScorer result = new DisjunctionMaxScorer(Enclosing_Instance.tieBreakerMultiplier, similarity); for (int i = 0; i < weights.Count; i++) { Weight w = (Weight)weights[i]; Scorer subScorer = w.Scorer(reader); if (subScorer == null) { return(null); } result.Add(subScorer); } return(result); }
/* Create the scorer used to score our associated DisjunctionMaxQuery */ public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer, IState state) { Scorer[] scorers = new Scorer[weights.Count]; int idx = 0; foreach (Weight w in weights) { Scorer subScorer = w.Scorer(reader, true, false, state); if (subScorer != null && subScorer.NextDoc(state) != DocIdSetIterator.NO_MORE_DOCS) { scorers[idx++] = subScorer; } } if (idx == 0) { return(null); // all scorers did not have documents } DisjunctionMaxScorer result = new DisjunctionMaxScorer(Enclosing_Instance.tieBreakerMultiplier, similarity, scorers, idx); return(result); }
/// <summary> /// Create the scorer used to score our associated <see cref="DisjunctionMaxQuery"/> </summary> public override Scorer GetScorer(AtomicReaderContext context, IBits acceptDocs) { IList <Scorer> scorers = new List <Scorer>(); foreach (Weight w in m_weights) { // we will advance() subscorers Scorer subScorer = w.GetScorer(context, acceptDocs); if (subScorer != null) { scorers.Add(subScorer); } } if (scorers.Count == 0) { // no sub-scorers had any documents return(null); } DisjunctionMaxScorer result = new DisjunctionMaxScorer(this, outerInstance.tieBreakerMultiplier, scorers.ToArray()); return(result); }
/* Create the scorer used to score our associated DisjunctionMaxQuery */ public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer) { Scorer[] scorers = new Scorer[weights.Count]; int idx = 0; for (System.Collections.IEnumerator iter = weights.GetEnumerator(); iter.MoveNext();) { Weight w = (Weight)iter.Current; Scorer subScorer = w.Scorer(reader, true, false); if (subScorer != null && subScorer.NextDoc() != DocIdSetIterator.NO_MORE_DOCS) { scorers[idx++] = subScorer; } } if (idx == 0) { return(null); // all scorers did not have documents } DisjunctionMaxScorer result = new DisjunctionMaxScorer(Enclosing_Instance.tieBreakerMultiplier, similarity, scorers, idx); return(result); }
/* Create the scorer used to score our associated DisjunctionMaxQuery */ public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer) { Scorer[] scorers = new Scorer[weights.Count]; int idx = 0; for (System.Collections.IEnumerator iter = weights.GetEnumerator(); iter.MoveNext(); ) { Weight w = (Weight) iter.Current; Scorer subScorer = w.Scorer(reader, true, false); if (subScorer != null && subScorer.NextDoc() != DocIdSetIterator.NO_MORE_DOCS) { scorers[idx++] = subScorer; } } if (idx == 0) return null; // all scorers did not have documents DisjunctionMaxScorer result = new DisjunctionMaxScorer(Enclosing_Instance.tieBreakerMultiplier, similarity, scorers, idx); return result; }
/* Create the scorer used to score our associated DisjunctionMaxQuery */ public virtual Scorer Scorer(IndexReader reader) { DisjunctionMaxScorer result = new DisjunctionMaxScorer(Enclosing_Instance.tieBreakerMultiplier, Enclosing_Instance.GetSimilarity(searcher)); for (int i = 0; i < weights.Count; i++) { Weight w = (Weight) weights[i]; Scorer subScorer = w.Scorer(reader); if (subScorer == null) return null; result.Add(subScorer); } return result; }