LUCENE-8078: The query cache should not cache instances of MatchNoDocsQuery

This commit is contained in:
Adrien Grand 2017-12-04 10:26:03 +01:00
parent faa77e92dd
commit bdaf1baa80
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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) {