Skip to content

Apache Lucene open-source search software

add comment

Mike McCandless3816a0eb2bbd
diff --git a/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java b/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
index 7ad208ff22f..44c04e54b7c 100644
--- a/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
+++ b/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
@@ -405,6 +405,7 @@ public class LRUQueryCache implements QueryCache, Accountable {
lock.lock();
try {
cache.clear();
+ // Note that this also clears the uniqueQueries map since mostRecentlyUsedQueries is the uniqueQueries.keySet view:
mostRecentlyUsedQueries.clear();
onClear();
} finally {