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


C# Collector.SetNextReader方法代码示例

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


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

示例1: Search

 public override void Search(Weight weight, Filter filter, Collector collector)
 {
     if (filter == null)
     {
         for (int index = 0; index < this.subReaders.Length; ++index)
         {
             collector.SetNextReader(this.subReaders[index], this.docStarts[index]);
             Scorer scorer = weight.Scorer(this.subReaders[index], !collector.AcceptsDocsOutOfOrder, true);
             if (scorer != null)
                 this.SearchWithScorer(this.subReaders[index], weight, scorer, collector);
         }
     }
     else
     {
         for (int index = 0; index < this.subReaders.Length; ++index)
         {
             collector.SetNextReader(this.subReaders[index], this.docStarts[index]);
             this.SearchWithFilter(this.subReaders[index], weight, filter, collector);
         }
     }
 }
开发者ID:NHSChoices,项目名称:location-service,代码行数:21,代码来源:GroupedIndexSearcher.cs

示例2: Search

 public override void Search(Weight weight, Filter filter, Collector collector)
 {
     if (filter == null)
     {
         for (int i = 0; i < subReaders.Length; i++)
         {
             // search each subreader
             collector.SetNextReader(subReaders[i], docStarts[i]);
             Scorer scorer = weight.Scorer(subReaders[i], !collector.AcceptsDocsOutOfOrder(), true);
             if (scorer != null)
             {
                 scorer.Score(collector);
             }
         }
     }
     else
     {
         for (int i = 0; i < subReaders.Length; i++)
         {
             // search each subreader
             collector.SetNextReader(subReaders[i], docStarts[i]);
             SearchWithFilter(subReaders[i], weight, filter, collector);
         }
     }
 }
开发者ID:sinsay,项目名称:SSE,代码行数:25,代码来源:IndexSearcher.cs

示例3: Search

        public override void Search(Weight weight, Filter filter, Collector results)
        {
            IndexReader reader = IndexReader;

            Scorer scorer = weight.Scorer(reader, true, false);

            if (scorer == null)
            {
                return;
            }

            results.SetScorer(scorer);
            results.SetNextReader(reader, 0);

            FacetValidator validator = CreateFacetValidator();
            int target = 0;
            bool more;

            if (filter == null)
            {
                more = scorer.NextDoc()!=DocIdSetIterator.NO_MORE_DOCS;
                while (more)
                {
                    target = scorer.DocID();
                    if (validator.Validate(target))
                    {
                        results.Collect(target);
                        more = scorer.NextDoc()!=DocIdSetIterator.NO_MORE_DOCS;
                    }
                    else
                    {
                        target = validator.NextTarget;
                        more = scorer.Advance(target) != DocIdSetIterator.NO_MORE_DOCS;
                    }
                }
                return;
            }

            DocIdSetIterator filterDocIdIterator = filter.GetDocIdSet(reader).Iterator(); // CHECKME: use ConjunctionScorer here?

            target = filterDocIdIterator.NextDoc();
            if (target == DocIdSetIterator.NO_MORE_DOCS)
            {
                return;
            }

            int doc = -1;
            while (true)
            {
                if (doc < target)
                {
                    doc = scorer.Advance(target);
                    if (doc == DocIdSetIterator.NO_MORE_DOCS)
                    {
                        break;
                    }
                }

                if (doc == target) // permitted by filter
                {
                    if (validator.Validate(doc))
                    {
                        results.Collect(doc);

                        target = filterDocIdIterator.NextDoc();
                        if (target == DocIdSetIterator.NO_MORE_DOCS)
                        {
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        // skip to the next possible docid
                        target = validator.NextTarget;
                    }
                }
                else // doc > target
                {
                    target = doc;
                }

                target = filterDocIdIterator.Advance(target);
                if (target == DocIdSetIterator.NO_MORE_DOCS)
                {
                    break;
                }
            }
        }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:92,代码来源:BoboSearcher2.cs


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