You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ji...@apache.org on 2019/10/22 13:19:13 UTC

[lucene-solr] branch branch_8_3 updated: LUCENE-9022: Never cache GlobalOrdinalsWithScoreQuery (#963)

This is an automated email from the ASF dual-hosted git repository.

jimczi pushed a commit to branch branch_8_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8_3 by this push:
     new 5245f1c  LUCENE-9022: Never cache GlobalOrdinalsWithScoreQuery (#963)
5245f1c is described below

commit 5245f1cb053d107d6fdf0276f96e678a658c2e90
Author: Jim Ferenczi <ji...@elastic.co>
AuthorDate: Tue Oct 22 15:14:36 2019 +0200

    LUCENE-9022: Never cache GlobalOrdinalsWithScoreQuery (#963)
---
 lucene/CHANGES.txt                                                 | 2 ++
 .../apache/lucene/search/join/GlobalOrdinalsWithScoreQuery.java    | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 56d1638..ffc38d34 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -141,6 +141,8 @@ Other
 * LUCENE-8999: LuceneTestCase.expectThrows now propogates assert/assumption failures up to the test
   w/o wrapping in a new assertion failure unless the caller has explicitly expected them (hossman)
 
+* LUCENE-8062: GlobalOrdinalsWithScoreQuery is no longer eligible for query caching. (Jim Ferenczi)
+
 ======================= Lucene 8.2.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 cd1f1f0..183bca1 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 {