You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2017/12/07 12:45:01 UTC
[07/50] [abbrv] lucene-solr:jira/solr-11285-sim: LUCENE-8078: The
query cache should not cache instances of MatchNoDocsQuery
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/bdaf1baa
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/bdaf1baa
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/bdaf1baa
Branch: refs/heads/jira/solr-11285-sim
Commit: bdaf1baa8081a55d738a622bf5510040a18286a3
Parents: faa77e9
Author: Adrien Grand <jp...@gmail.com>
Authored: Mon Dec 4 10:26:03 2017 +0100
Committer: Adrien Grand <jp...@gmail.com>
Committed: Mon Dec 4 10:26:03 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/bdaf1baa/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 10a6351..c861566 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -127,6 +127,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/bdaf1baa/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) {