예제 #1
0
            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);
            }
예제 #2
0
 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();
     }
 }
예제 #3
0
        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());
        }
예제 #4
0
            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"));
            }
예제 #5
0
 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());
 }
예제 #6
0
 public override void Collect(int doc)
 {
     Assert.IsFalse(float.IsInfinity(scorer.Freq()));
     Assert.IsFalse(float.IsInfinity(scorer.Score()));
 }
예제 #7
0
 public override void Collect(int doc)
 {
     TotalHits++;
     Max = Math.Max(Max, Scorer_Renamed.Freq());
 }
예제 #8
0
 public override int Freq()
 {
     Debug.Assert(Iterating());
     return(@in.Freq());
 }
예제 #9
0
 public override sealed int Freq()
 {
     return(Scorer.Freq());
 }
예제 #10
0
 public override int Freq()
 {
     return(Scorer.Freq());
 }
예제 #11
0
 public override int Freq()
 {
     return(CountingSumScorer.Freq());
 }