示例#1
0
            // return a filtering scorer
            public virtual Scorer Scorer(IndexReader indexReader)
            {
                Scorer scorer = weight.Scorer(indexReader);

                System.Collections.BitArray bitset = Enclosing_Instance.filter.Bits(indexReader);
                return(new AnonymousClassScorer(bitset, scorer, this, similarity));
            }
示例#2
0
        public virtual void  TestSpanNearScorerSkipTo1()
        {
            SpanNearQuery q = MakeQuery();
            Weight        w = q.Weight(searcher);
            Scorer        s = w.Scorer(searcher.GetIndexReader(), true, false);

            Assert.AreEqual(1, s.Advance(1));
        }
示例#3
0
        public virtual void  TestSpanNearScorerExplain()
        {
            SpanNearQuery q = MakeQuery();
            Weight        w = q.Weight(searcher);
            Scorer        s = w.Scorer(searcher.GetIndexReader(), true, false);
            Explanation   e = s.Explain(1);

            Assert.IsTrue(0.0f < e.GetValue(), "Scorer explanation value for doc#1 isn't positive: " + e.ToString());
        }
示例#4
0
            /*(non-Javadoc) @see Lucene.Net.Search.Weight#scorer(Lucene.Net.Index.IndexReader) */
            public virtual Scorer Scorer(IndexReader reader)
            {
                Scorer subQueryScorer = subQueryWeight.Scorer(reader);

                Scorer[] valSrcScorers = new Scorer[valSrcWeights.Length];
                for (int i = 0; i < valSrcScorers.Length; i++)
                {
                    valSrcScorers[i] = valSrcWeights[i].Scorer(reader);
                }
                return(new CustomScorer(enclosingInstance, similarity, reader, this, subQueryScorer, valSrcScorers));
            }
示例#5
0
            public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer)
            {
                // Pass true for "scoresDocsInOrder", because we
                // require in-order scoring, even if caller does not,
                // since we call advance on the valSrcScorers.  Pass
                // false for "topScorer" because we will not invoke
                // score(Collector) on these scorers:
                Scorer subQueryScorer = subQueryWeight.Scorer(reader, true, false);

                if (subQueryScorer == null)
                {
                    return(null);
                }
                Scorer[] valSrcScorers = new Scorer[valSrcWeights.Length];
                for (int i = 0; i < valSrcScorers.Length; i++)
                {
                    valSrcScorers[i] = valSrcWeights[i].Scorer(reader, true, topScorer);
                }
                return(new CustomScorer(enclosingInstance, similarity, reader, this, subQueryScorer, valSrcScorers));
            }
示例#6
0
            // return a filtering scorer
            public override Scorer Scorer(IndexReader indexReader, bool scoreDocsInOrder, bool topScorer)
            {
                Scorer scorer = weight.Scorer(indexReader, true, false);

                if (scorer == null)
                {
                    return(null);
                }
                DocIdSet docIdSet = Enclosing_Instance.filter.GetDocIdSet(indexReader);

                if (docIdSet == null)
                {
                    return(null);
                }
                DocIdSetIterator docIdSetIterator = docIdSet.Iterator();

                if (docIdSetIterator == null)
                {
                    return(null);
                }

                return(new AnonymousClassScorer(scorer, docIdSetIterator, this, similarity));
            }
示例#7
0
 public override DocIdSetIterator Iterator()
 {
     return(weight.Scorer(reader, true, false));
 }
示例#8
0
 public override DocIdSetIterator GetIterator()
 {
     return(Weight.Scorer(PrivateContext, AcceptDocs));
 }