LUCENE-9022: Never cache GlobalOrdinalsWithScoreQuery (#963)

This commit is contained in:
Jim Ferenczi 2019-10-22 15:14:36 +02:00 committed by jimczi
parent c5d91017d0
commit c89ec4b074
2 changed files with 9 additions and 0 deletions

View File

@ -186,6 +186,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 =======================

View File

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