mirror of https://github.com/apache/lucene.git
LUCENE-6784: IndexSearcher's query caching is enabled by default.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1701964 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
41daf71ed4
commit
db6083e255
|
@ -181,6 +181,9 @@ Changes in Runtime Behavior
|
|||
removes the collector that threw this exception from the list of sub
|
||||
collectors to collect. (Adrien Grand)
|
||||
|
||||
* LUCENE-6784: IndexSearcher's query caching is enabled by default. Run
|
||||
indexSearcher.setQueryCache(null) to disable. (Adrien Grand)
|
||||
|
||||
======================= Lucene 5.3.0 =======================
|
||||
|
||||
New Features
|
||||
|
|
|
@ -125,9 +125,14 @@ public class IndexSearcher {
|
|||
|
||||
};
|
||||
|
||||
// disabled by default
|
||||
private static QueryCache DEFAULT_QUERY_CACHE = null;
|
||||
private static QueryCache DEFAULT_QUERY_CACHE;
|
||||
private static QueryCachingPolicy DEFAULT_CACHING_POLICY = new UsageTrackingQueryCachingPolicy();
|
||||
static {
|
||||
final int maxCachedQueries = 1000;
|
||||
// min of 32MB or 5% of the heap size
|
||||
final long maxRamBytesUsed = Math.min(1L << 25, Runtime.getRuntime().maxMemory() / 20);
|
||||
DEFAULT_QUERY_CACHE = new LRUQueryCache(maxCachedQueries, maxRamBytesUsed);
|
||||
}
|
||||
|
||||
final IndexReader reader; // package private for testing!
|
||||
|
||||
|
|
Loading…
Reference in New Issue