Example usage for org.apache.lucene.search UsageTrackingQueryCachingPolicy UsageTrackingQueryCachingPolicy

List of usage examples for org.apache.lucene.search UsageTrackingQueryCachingPolicy UsageTrackingQueryCachingPolicy

Introduction

In this page you can find the example usage for org.apache.lucene.search UsageTrackingQueryCachingPolicy UsageTrackingQueryCachingPolicy.

Prototype

public UsageTrackingQueryCachingPolicy() 

Source Link

Document

Create a new instance with an history size of 256.

Usage

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());
    }
}