Apache Lucene open-source search software
LUCENE-8062: GlobalOrdinalsQuery is no longer eligible for caching
Jim Ferenczia06e685642a9
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 7df88fc3705..084d0dd0d05 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -121,6 +121,8 @@ Optimizations* LUCENE-7994: Use int/int scatter map to gather facet counts when thenumber of hits is small relative to the number of unique facet labels(Dawid Weiss, Robert Muir, Mike McCandless)++* LUCENE-8062: GlobalOrdinalsQuery is no longer eligible for caching. (Jim Ferenczi)Testsdiff --git a/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsQuery.java b/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsQuery.javaindex 4b2d987addb..b1c0b91adfb 100644--- a/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsQuery.java+++ b/lucene/join/src/java/org/apache/lucene/search/join/GlobalOrdinalsQuery.java@@ -156,7 +156,10 @@ final class GlobalOrdinalsQuery extends Query {@Overridepublic boolean isCacheable(LeafReaderContext ctx) {- return DocValues.isCacheable(ctx, joinField);+ // 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;}}