コード例 #1
0
ファイル: FilteredQuery.cs プロジェクト: ferrod20/tprilucene
            // 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));
 }