当前位置: 首页>>代码示例>>C#>>正文


C# AtomicReaderContext.Reader方法代码示例

本文整理汇总了C#中Lucene.Net.Index.AtomicReaderContext.Reader方法的典型用法代码示例。如果您正苦于以下问题:C# AtomicReaderContext.Reader方法的具体用法?C# AtomicReaderContext.Reader怎么用?C# AtomicReaderContext.Reader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lucene.Net.Index.AtomicReaderContext的用法示例。


在下文中一共展示了AtomicReaderContext.Reader方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoSimScorer

 public override sealed SimScorer DoSimScorer(SimWeight stats, AtomicReaderContext context)
 {
     BM25Stats bm25stats = (BM25Stats)stats;
     return new BM25DocScorer(this, bm25stats, ((AtomicReader)context.Reader()).GetNormValues(bm25stats.Field));
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:5,代码来源:BM25Similarity.cs

示例2: GetDocIdSet

            public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
            {
                SortedSetDocValues docTermOrds = FieldCache_Fields.DEFAULT.GetDocTermOrds(((AtomicReader)context.Reader()), Field);
                long lowerPoint = LowerVal == null ? -1 : docTermOrds.LookupTerm(LowerVal);
                long upperPoint = UpperVal == null ? -1 : docTermOrds.LookupTerm(UpperVal);

                long inclusiveLowerPoint, inclusiveUpperPoint;

                // Hints:
                // * binarySearchLookup returns -1, if value was null.
                // * the value is <0 if no exact hit was found, the returned value
                //   is (-(insertion point) - 1)
                if (lowerPoint == -1 && LowerVal == null)
                {
                    inclusiveLowerPoint = 0;
                }
                else if (IncludeLower && lowerPoint >= 0)
                {
                    inclusiveLowerPoint = lowerPoint;
                }
                else if (lowerPoint >= 0)
                {
                    inclusiveLowerPoint = lowerPoint + 1;
                }
                else
                {
                    inclusiveLowerPoint = Math.Max(0, -lowerPoint - 1);
                }

                if (upperPoint == -1 && UpperVal == null)
                {
                    inclusiveUpperPoint = long.MaxValue;
                }
                else if (IncludeUpper && upperPoint >= 0)
                {
                    inclusiveUpperPoint = upperPoint;
                }
                else if (upperPoint >= 0)
                {
                    inclusiveUpperPoint = upperPoint - 1;
                }
                else
                {
                    inclusiveUpperPoint = -upperPoint - 2;
                }

                if (inclusiveUpperPoint < 0 || inclusiveLowerPoint > inclusiveUpperPoint)
                {
                    return null;
                }

                Debug.Assert(inclusiveLowerPoint >= 0 && inclusiveUpperPoint >= 0);

                return new FieldCacheDocIdSetAnonymousInnerClassHelper(this, context.Reader().MaxDoc(), acceptDocs, docTermOrds, inclusiveLowerPoint, inclusiveUpperPoint);
            }
开发者ID:joyanta,项目名称:lucene.net,代码行数:55,代码来源:DocTermOrdsRangeFilter.cs

示例3: GetDocIdSet

 public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
 {
     return new FixedBitSet(context.Reader().MaxDoc());
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:4,代码来源:TestCachingWrapperFilter.cs

示例4: Explain

 public override Explanation Explain(AtomicReaderContext ir, int i)
 {
     Explanation inner = Weight.Explain(ir, i);
     Filter f = OuterInstance.Filter_Renamed;
     DocIdSet docIdSet = f.GetDocIdSet(ir, ((AtomicReader)ir.Reader()).LiveDocs);
     DocIdSetIterator docIdSetIterator = docIdSet == null ? DocIdSetIterator.Empty() : docIdSet.GetIterator();
     if (docIdSetIterator == null)
     {
         docIdSetIterator = DocIdSetIterator.Empty();
     }
     if (docIdSetIterator.Advance(i) == i)
     {
         return inner;
     }
     else
     {
         Explanation result = new Explanation(0.0f, "failure to match filter: " + f.ToString());
         result.AddDetail(inner);
         return result;
     }
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:21,代码来源:FilteredQuery.cs

示例5: Explain

            public override Explanation Explain(AtomicReaderContext context, int doc)
            {
                PayloadNearSpanScorer scorer = (PayloadNearSpanScorer)Scorer(context, ((AtomicReader)context.Reader()).LiveDocs);
                if (scorer != null)
                {
                    int newDoc = scorer.Advance(doc);
                    if (newDoc == doc)
                    {
                        float freq = scorer.Freq();
                        Similarity.SimScorer docScorer = Similarity.DoSimScorer(Stats, context);
                        Explanation expl = new Explanation();
                        expl.Description = "weight(" + Query + " in " + doc + ") [" + Similarity.GetType().Name + "], result of:";
                        Explanation scoreExplanation = docScorer.Explain(doc, new Explanation(freq, "phraseFreq=" + freq));
                        expl.AddDetail(scoreExplanation);
                        expl.Value = scoreExplanation.Value;
                        string field = ((SpanQuery)Query).Field;
                        // now the payloads part
                        Explanation payloadExpl = OuterInstance.Function.Explain(doc, field, scorer.PayloadsSeen, scorer.PayloadScore);
                        // combined
                        ComplexExplanation result = new ComplexExplanation();
                        result.AddDetail(expl);
                        result.AddDetail(payloadExpl);
                        result.Value = expl.Value * payloadExpl.Value;
                        result.Description = "PayloadNearQuery, product of:";
                        return result;
                    }
                }

                return new ComplexExplanation(false, 0.0f, "no matching term");
            }
开发者ID:joyanta,项目名称:lucene.net,代码行数:30,代码来源:PayloadNearQuery.cs

示例6: SetNextReader

 public override FieldComparator SetNextReader(AtomicReaderContext context)
 {
     idIndex = FieldCache_Fields.DEFAULT.GetTermsIndex((AtomicReader)context.Reader(), Fieldname);
     return this;
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:5,代码来源:TestElevationComparator.cs


注:本文中的Lucene.Net.Index.AtomicReaderContext.Reader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。