public override void Collect(int doc) { IDictionary <Query, float?> freqs = new Dictionary <Query, float?>(); foreach (KeyValuePair <Query, Scorer> ent in SubScorers) { Scorer value = ent.Value; int matchId = value.DocID(); freqs[ent.Key] = matchId == doc?value.Freq() : 0.0f; } DocCounts[doc + DocBase] = freqs; Other.Collect(doc); }
public override void Collect(int doc) { DocIDs[Buffered] = doc; Scores[Buffered] = Scorer_Renamed.Score(); try { Freqs[Buffered] = Scorer_Renamed.Freq(); } catch (System.NotSupportedException) { Freqs[Buffered] = -1; } if (++Buffered == BufferSize) { Flush(); } }
private void AssertNext(Scorer expected, Scorer actual) { if (actual == null) { Assert.AreEqual(DocIdSetIterator.NO_MORE_DOCS, expected.NextDoc()); return; } int doc; while ((doc = expected.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS) { Assert.AreEqual(doc, actual.NextDoc()); Assert.AreEqual(expected.Freq(), actual.Freq()); float expectedScore = expected.Score(); float actualScore = actual.Score(); Assert.AreEqual(expectedScore, actualScore, CheckHits.ExplainToleranceDelta(expectedScore, actualScore)); } Assert.AreEqual(DocIdSetIterator.NO_MORE_DOCS, actual.NextDoc()); }
public override Explanation Explain(AtomicReaderContext context, int doc) { Scorer scorer = Scorer(context, context.AtomicReader.LiveDocs); if (scorer != null) { int newDoc = scorer.Advance(doc); if (newDoc == doc) { float freq = scorer.Freq(); SimScorer docScorer = Similarity.DoSimScorer(Stats, context); ComplexExplanation result = new ComplexExplanation(); result.Description = "weight(" + Query + " in " + doc + ") [" + Similarity.GetType().Name + "], result of:"; Explanation scoreExplanation = docScorer.Explain(doc, new Explanation(freq, "termFreq=" + freq)); result.AddDetail(scoreExplanation); result.Value = scoreExplanation.Value; result.Match = true; return(result); } } return(new ComplexExplanation(false, 0.0f, "no matching term")); }
public override void Collect(int doc) { Assert.IsFalse(float.IsInfinity(scorer.Freq())); Assert.IsFalse(float.IsInfinity(scorer.Score())); }
public override void Collect(int doc) { TotalHits++; Max = Math.Max(Max, Scorer_Renamed.Freq()); }
public override int Freq() { Debug.Assert(Iterating()); return(@in.Freq()); }
public override sealed int Freq() { return(Scorer.Freq()); }
public override int Freq() { return(Scorer.Freq()); }
public override int Freq() { return(CountingSumScorer.Freq()); }