create

fun create(cacheScores: Boolean, maxRAMMB: Double): CachingCollector

Creates a CachingCollector which does not wrap another collector. The cached documents and scores can later be replayed.


fun create(other: Collector, cacheScores: Boolean, maxRAMMB: Double): CachingCollector

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

Parameters

other

the Collector to wrap and delegate calls to.

cacheScores

whether to cache scores in addition to document IDs. Note that this increases the RAM consumed per doc

maxRAMMB

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.


fun create(other: Collector, cacheScores: Boolean, maxDocsToCache: Int): CachingCollector

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

Parameters

other

the Collector to wrap and delegate calls to.

cacheScores

whether to cache scores in addition to document IDs. Note that this increases the RAM consumed per doc

maxDocsToCache

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.