示例#1
0
            public override void Collect(int doc)
            {
                float score = Scorer_Renamed.Score();

                // this collector cannot handle these scores:
                Debug.Assert(score != float.NegativeInfinity);
                Debug.Assert(!float.IsNaN(score));

                TotalHits_Renamed++;

                if (score > After.Score || (score == After.Score && doc <= AfterDoc))
                {
                    // hit was collected on a previous page
                    return;
                }

                if (score <= PqTop.Score)
                {
                    // Since docs are returned in-order (i.e., increasing doc Id), a document
                    // with equal score to pqTop.score cannot compete since HitQueue favors
                    // documents with lower doc Ids. Therefore reject those docs too.
                    return;
                }
                CollectedHits++;
                PqTop.Doc   = doc + DocBase;
                PqTop.Score = score;
                PqTop       = Pq.UpdateTop();
            }
示例#2
0
            public override void Collect(int doc)
            {
                float score = Scorer_Renamed.Score();

                // this collector cannot handle NaN
                Debug.Assert(!float.IsNaN(score));

                TotalHits_Renamed++;
                if (score > After.Score || (score == After.Score && doc <= AfterDoc))
                {
                    // hit was collected on a previous page
                    return;
                }
                if (score < PqTop.Score)
                {
                    // Doesn't compete w/ bottom entry in queue
                    return;
                }
                doc += DocBase;
                if (score == PqTop.Score && doc > PqTop.Doc)
                {
                    // Break tie in score by doc ID:
                    return;
                }
                CollectedHits++;
                PqTop.Doc   = doc;
                PqTop.Score = score;
                PqTop       = Pq.UpdateTop();
            }