本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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;
}
}
}