C# 클래스 Lucene.Net.Search.CachingCollector

Caches all docs, and optionally also scores, coming from a search, and is then able to replay them to another collector. You specify the max RAM this class may use. Once the collection is done, call #isCached. If this returns true, you can use #replay(Collector) against a new collector. If it returns false, this means too much RAM was required and you must instead re-run the original search.

NOTE: this class consumes 4 (or 8 bytes, if scoring is cached) per collected document. If the result set is large this can easily be a very substantial amount of RAM!

NOTE: this class caches at least 128 documents before checking RAM limits.

See the Lucene modules/grouping module for more details including a full code example.

@lucene.experimental
상속: Collector
파일 보기 프로젝트 열기: apache/lucenenet

보호된 프로퍼티들

프로퍼티 타입 설명
@base int
CachedDocs IList
CurDocs int[]
LastDocBase int
MaxDocsToCache int
Other Collector
Upto int

공개 메소드들

메소드 설명
AcceptsDocsOutOfOrder ( ) : bool
Create ( Collector other, bool cacheScores, double maxRAMMB ) : CachingCollector

Create a new CachingCollector that wraps the given collector and caches documents and scores up to the specified RAM threshold.

Create ( Collector other, bool cacheScores, int maxDocsToCache ) : CachingCollector

Create a new CachingCollector that wraps the given collector and caches documents and scores up to the specified max docs threshold.

Create ( bool acceptDocsOutOfOrder, bool cacheScores, double maxRAMMB ) : CachingCollector

Creates a CachingCollector which does not wrap another collector. The cached documents and scores can later be {@link #replay(Collector) replayed}.

Replay ( Collector other ) : void

Replays the cached doc IDs (and scores) to the given Collector. If this instance does not cache scores, then Scorer is not set on {@code other.setScorer} as well as scores are not replayed.

비공개 메소드들

메소드 설명
CachingCollector ( Collector other, double maxRAMMB, bool cacheScores ) : System.Collections.Generic
CachingCollector ( Collector other, int maxDocsToCache ) : System.Collections.Generic
ReplayInit ( Collector other ) : void

Reused by the specialized inner classes.

메소드 상세

AcceptsDocsOutOfOrder() 공개 메소드

public AcceptsDocsOutOfOrder ( ) : bool
리턴 bool

Create() 공개 정적인 메소드

Create a new CachingCollector that wraps the given collector and caches documents and scores up to the specified RAM threshold.
public static Create ( Collector other, bool cacheScores, double maxRAMMB ) : CachingCollector
other Collector /// the Collector to wrap and delegate calls to.
cacheScores bool /// whether to cache scores in addition to document IDs. Note that /// this increases the RAM consumed per doc
maxRAMMB double /// the maximum RAM in MB to consume for caching the documents and /// scores. If the collector exceeds the threshold, no documents and /// scores are cached.
리턴 CachingCollector

Create() 공개 정적인 메소드

Create a new CachingCollector that wraps the given collector and caches documents and scores up to the specified max docs threshold.
public static Create ( Collector other, bool cacheScores, int maxDocsToCache ) : CachingCollector
other Collector /// the Collector to wrap and delegate calls to.
cacheScores bool /// whether to cache scores in addition to document IDs. Note that /// this increases the RAM consumed per doc
maxDocsToCache int /// the maximum number of documents for caching the documents and /// possible the scores. If the collector exceeds the threshold, /// no documents and scores are cached.
리턴 CachingCollector

Create() 공개 정적인 메소드

Creates a CachingCollector which does not wrap another collector. The cached documents and scores can later be {@link #replay(Collector) replayed}.
public static Create ( bool acceptDocsOutOfOrder, bool cacheScores, double maxRAMMB ) : CachingCollector
acceptDocsOutOfOrder bool /// whether documents are allowed to be collected out-of-order
cacheScores bool
maxRAMMB double
리턴 CachingCollector

Replay() 공개 추상적인 메소드

Replays the cached doc IDs (and scores) to the given Collector. If this instance does not cache scores, then Scorer is not set on {@code other.setScorer} as well as scores are not replayed.
/// if this collector is not cached (i.e., if the RAM limits were too /// low for the number of documents + scores to cache). /// if the given Collect's does not support out-of-order collection, /// while the collector passed to the ctor does.
public abstract Replay ( Collector other ) : void
other Collector
리턴 void

프로퍼티 상세

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

protected int @base
리턴 int

CachedDocs 보호되어 있는 프로퍼티

protected IList CachedDocs
리턴 IList

CurDocs 보호되어 있는 프로퍼티

protected int[] CurDocs
리턴 int[]

LastDocBase 보호되어 있는 프로퍼티

protected int LastDocBase
리턴 int

MaxDocsToCache 보호되어 있는 프로퍼티

protected int MaxDocsToCache
리턴 int

Other 보호되어 있는 프로퍼티

protected Collector,Lucene.Net.Search Other
리턴 Collector

Upto 보호되어 있는 프로퍼티

protected int Upto
리턴 int