lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [3/3] lucene-solr:branch_7x: LUCENE-8078: The query cache should not cache instances of MatchNoDocsQuery
Date Mon, 04 Dec 2017 09:54:29 GMT
LUCENE-8078: The query cache should not cache instances of MatchNoDocsQuery


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/24f0fa5d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/24f0fa5d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/24f0fa5d

Branch: refs/heads/branch_7x
Commit: 24f0fa5dc481d394de2c3ba6764195b1906b2903
Parents: 9e162e9
Author: Adrien Grand <jpountz@gmail.com>
Authored: Mon Dec 4 10:26:03 2017 +0100
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Mon Dec 4 10:53:56 2017 +0100

----------------------------------------------------------------------
 lucene/CHANGES.txt                                                | 3 +++
 .../org/apache/lucene/search/UsageTrackingQueryCachingPolicy.java | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f0fa5d/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 551b87d..432f9b3 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -88,6 +88,9 @@ Bug Fixes
 * LUCENE-8034: Use subtraction instead of addition to sidestep int
   overflow in SpanNotQuery.  (Hari Menon via Mike McCandless)
 
+* LUCENE-8078: The query cache should not cache instances of
+  MatchNoDocsQuery. (Jon Harper via Adrien Grand)
+
 Optimizations
 
 * LUCENE-8018: Smaller FieldInfos memory footprint by not retaining unnecessary

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24f0fa5d/lucene/core/src/java/org/apache/lucene/search/UsageTrackingQueryCachingPolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/UsageTrackingQueryCachingPolicy.java
b/lucene/core/src/java/org/apache/lucene/search/UsageTrackingQueryCachingPolicy.java
index 1bbed5c..c16d7f2 100644
--- a/lucene/core/src/java/org/apache/lucene/search/UsageTrackingQueryCachingPolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/search/UsageTrackingQueryCachingPolicy.java
@@ -68,7 +68,7 @@ public class UsageTrackingQueryCachingPolicy implements QueryCachingPolicy
{
     // For the below queries, it's cheap to notice they cannot match any docs so
     // we do not bother caching them.
     if (query instanceof MatchNoDocsQuery) {
-      return false;
+      return true;
     }
 
     if (query instanceof BooleanQuery) {


Mime
View raw message