Skip to content
Open
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 @@ -368,6 +368,8 @@ Bug Fixes

* GITHUB#14616 : Fix mis-interpretation of `maxNumBytes` in FuzzySet#createSetBasedOnMaxMemory (Greg Miller)

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

* GITHUB#15554: Fix tessellator failure by preferring the shared vertex that is the leftmost vertex of the hole
(Ignacio Vera)

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