C# 클래스 Lucene.Net.Index.Sorter.EarlyTerminatingSortingCollector

A Collector that early terminates collection of documents on a per-segment basis, if the segment was sorted according to the given Sort.

NOTE: the Collector detects sorted segments according to SortingMergePolicy, so it's best used in conjunction with it. Also, it collects up to a specified numDocsToCollect from each segment, and therefore is mostly suitable for use in conjunction with collectors such as Search.TopDocsCollector{T}, and not e.g. TotalHitCountCollector.

NOTE: If you wrap a Search.TopDocsCollector{T} that sorts in the same order as the index order, the returned TopDocs will be correct. However the total of TopDocsCollector{T}.TotalHits hit count will be underestimated since not all matching documents will have been collected.

NOTE: This Collector uses Sort.ToString() to detect whether a segment was sorted with the same Sort. This has two implications:

  • if a custom comparator is not implemented correctly and returns different identifiers for equivalent instances, this collector will not detect sorted segments,
  • if you suddenly change the IndexWriter's SortingMergePolicy to sort according to another criterion and if both the old and the new Sorts have the same identifier, this Collector will incorrectly detect sorted segments.
@lucene.experimental

상속: Lucene.Net.Search.Collector
파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
@in Lucene.Net.Search.Collector
numDocsToCollect int
segmentSorted bool
segmentTotalCollect int
sort Lucene.Net.Search.Sort

공개 메소드들

메소드 설명
AcceptsDocsOutOfOrder ( ) : bool
Collect ( int doc ) : void
EarlyTerminatingSortingCollector ( Collector @in, Lucene.Net.Search.Sort sort, int numDocsToCollect ) : Lucene.Net.Search

Create a new EarlyTerminatingSortingCollector instance.

메소드 상세

AcceptsDocsOutOfOrder() 공개 메소드

public AcceptsDocsOutOfOrder ( ) : bool
리턴 bool

Collect() 공개 메소드

public Collect ( int doc ) : void
doc int
리턴 void

EarlyTerminatingSortingCollector() 공개 메소드

Create a new EarlyTerminatingSortingCollector instance.
public EarlyTerminatingSortingCollector ( Collector @in, Lucene.Net.Search.Sort sort, int numDocsToCollect ) : Lucene.Net.Search
@in Lucene.Net.Search.Collector
sort Lucene.Net.Search.Sort /// the sort you are sorting the search results on
numDocsToCollect int /// the number of documents to collect on each segment. When wrapping /// a , this number should be the number of /// hits.
리턴 Lucene.Net.Search

프로퍼티 상세

@in 보호되어 있는 프로퍼티

The wrapped Collector
protected Collector,Lucene.Net.Search @in
리턴 Lucene.Net.Search.Collector

numDocsToCollect 보호되어 있는 프로퍼티

Number of documents to collect in each segment
protected int numDocsToCollect
리턴 int

segmentSorted 보호되어 있는 프로퍼티

True if the current segment being processed is sorted by Sort()
protected bool segmentSorted
리턴 bool

segmentTotalCollect 보호되어 있는 프로퍼티

Number of documents to collect in the current segment being processed
protected int segmentTotalCollect
리턴 int

sort 보호되어 있는 프로퍼티

Sort used to sort the search results
protected Sort,Lucene.Net.Search sort
리턴 Lucene.Net.Search.Sort