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 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!
See the Lucene `modules/grouping` module for more details including a full code example.
Properties
Set the Weight that will be used to produce scorers that will feed [ ]s. This is typically useful to have access to Weight.count from .