Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ Bug Fixes
* GITHUB#15731: Fix tessellator failure when a hole is touching another hole in the middle of a segment. In this case
we might fail to detect it and choose a wrong bridge to eliminate the hole. (Ignacio Vera)

* GITHUB#15656: Fix wrong BitSet result in MemoryAccountingBitsetCollector (Binlong Gao)

Other
---------------------
* GITHUB#15586: Document that scoring and ranking may change across major Lucene versions, and that applications requiring stable ranking should explicitly configure Similarity. (Parveen Saini)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public MemoryAccountingBitsetCollector(CollectorMemoryTracker tracker) {

@Override
protected void doSetNextReader(LeafReaderContext context) throws IOException {
docBase = context.docBase;
length += context.reader().maxDoc();
FixedBitSet newBitSet = FixedBitSet.ensureCapacity(bitSet, length);
if (newBitSet != bitSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,18 @@ public void testMemoryAccountingBitsetCollectorMemoryLimit() {
searcher.search(MatchAllDocsQuery.INSTANCE, bitSetCollector);
});
}

public void testCollectedResult() throws Exception {
CollectorMemoryTracker tracker =
new CollectorMemoryTracker("testMemoryTracker", Long.MAX_VALUE);
MemoryAccountingBitsetCollector collector = new MemoryAccountingBitsetCollector(tracker);

IndexSearcher searcher = new IndexSearcher(reader);
searcher.search(MatchAllDocsQuery.INSTANCE, collector);

assertEquals(1000, collector.bitSet.cardinality());
for (int i = 0; i < 1000; i++) {
assertTrue(collector.bitSet.get(i));
}
}
}
Loading