From 2ee8426d5e53879424102afa9d6e59c1c62414c9 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Thu, 21 Apr 2016 17:01:43 +0200 Subject: [PATCH] LUCENE-7238: Explicitly disable the query cache in MemoryIndex.createSearcher. --- lucene/CHANGES.txt | 3 +++ .../src/java/org/apache/lucene/index/memory/MemoryIndex.java | 1 + 2 files changed, 4 insertions(+) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 7c30ef45ee6..da5a3457958 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -73,6 +73,9 @@ Optimizations * LUCENE-7235: LRUQueryCache should not take a lock for segments that it will not cache on anyway. (Adrien Grand) +* LUCENE-7238: Explicitly disable the query cache in MemoryIndex#createSearcher. + (Adrien Grand) + Bug Fixes * LUCENE-7127: Fix corner case bugs in GeoPointDistanceQuery. (Robert Muir) diff --git a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java index 58a10172329..5b133013ed5 100644 --- a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java +++ b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java @@ -666,6 +666,7 @@ public class MemoryIndex { MemoryIndexReader reader = new MemoryIndexReader(); IndexSearcher searcher = new IndexSearcher(reader); // ensures no auto-close !! searcher.setSimilarity(normSimilarity); + searcher.setQueryCache(null); return searcher; }