Class LRUStatsCache

  • All Implemented Interfaces:

    public class LRUStatsCache
    extends ExactStatsCache
    Unlike ExactStatsCache this implementation preserves term stats across queries in a set of LRU caches (with the same life-cycle as SolrIndexSearcher), and based on surface features of a query it determines the need to send additional requests to retrieve local term and collection statistics from shards. As a result the additional requests may be needed much less frequently.

    Query terms, their stats and field stats are maintained in LRU caches, with the size by default DEFAULT_MAX_SIZE, one cache per shard. These caches are updated as needed (when term or field statistics are missing). Each instance of the component keeps also a global stats cache, which is aggregated from per-shard caches.

    Cache entries expire after a max idle time, by default DEFAULT_MAX_IDLE_TIME.