List of usage examples for org.apache.lucene.search UsageTrackingQueryCachingPolicy UsageTrackingQueryCachingPolicy
public UsageTrackingQueryCachingPolicy()
From source file:org.elasticsearch.index.cache.filter.FilterCacheModule.java
License:Apache License
@Override protected void configure() { bind(FilterCache.class).to(settings.getAsClass(FilterCacheSettings.FILTER_CACHE_TYPE, WeightedFilterCache.class, "org.elasticsearch.index.cache.filter.", "FilterCache")) .in(Scopes.SINGLETON);/* w ww.j av a2 s .c o m*/ // the filter cache is a node-level thing, however we want the most popular filters // to be computed on a per-index basis, that is why we don't use the SINGLETON // scope below if (settings.getAsBoolean(FilterCacheSettings.FILTER_CACHE_EVERYTHING, false)) { bind(QueryCachingPolicy.class).toInstance(QueryCachingPolicy.ALWAYS_CACHE); } else { bind(QueryCachingPolicy.class).toInstance(new UsageTrackingQueryCachingPolicy()); } }