Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-9022: Never cache GlobalOrdinalsWithScoreQuery (#963)

Jim Ferenczic68470e57764
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 05688250ca4..fe955814f5a 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -64,6 +64,8 @@ Other
* LUCENE-8768: Fix Javadocs build in Java 11. (Namgyu Kim)
+* LUCENE-8062: GlobalOrdinalsWithScoreQuery is no longer eligible for query caching. (Jim Ferenczi)
+
======================= Lucene 8.4.0 =======================
API Changes
diff --git a/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsWithScoreQuery.java b/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsWithScoreQuery.java
index cd1f1f0ee09..183bca19ca9 100644
--- a/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsWithScoreQuery.java
+++ b/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsWithScoreQuery.java
@@ -190,6 +190,13 @@ final class GlobalOrdinalsWithScoreQuery extends Query implements Accountable {
}
}
+ @Override
+ public boolean isCacheable(LeafReaderContext ctx) {
+ // disable caching because this query relies on a top reader context
+ // and holds a bitset of matching ordinals that cannot be accounted in
+ // the memory used by the cache
+ return false;
+ }
}
final static class OrdinalMapScorer extends BaseGlobalOrdinalScorer {