Skip to content

Commit 189b90b

Browse files
committed
LUCENE-15108: use writer.getReader instead of DirectoryReader.open
1 parent c5d8242 commit 189b90b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lucene/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ Bug Fixes
9696
* GITHUB#14847: Allow Faiss vector format to index >2GB of vectors per-field per-segment by using MemorySegment APIs
9797
(instead of ByteBuffer) to copy bytes to native memory. (Kaival Parikh)
9898

99+
* GITHUB#15108: Fixed test failure caused by DirectoryReader.open() reading an index with uncommitted changes. (Vivek Kumar)
100+
99101
* GITHUB#15213: Don't normalize centroids with zero samples, which caused divide-by-zero. (Mike Sokolov)
100102

101103
* GITHUB#15125: Handle inconsistent schema on flush with index sorts (Nhat Nguyen)

lucene/test-framework/src/java/org/apache/lucene/tests/index/LegacyBaseDocValuesFormatTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,14 +1544,14 @@ private void doTestSortedNumericsVsStoredFields(LongSupplier counts, LongSupplie
15441544
int id = random().nextInt(numDocs);
15451545
writer.deleteDocuments(new Term("id", Integer.toString(id)));
15461546
}
1547-
try (DirectoryReader reader = maybeWrapWithMergingReader(DirectoryReader.open(dir))) {
1547+
try (DirectoryReader reader = maybeWrapWithMergingReader(writer.getReader())) {
15481548
TestUtil.checkReader(reader);
15491549
compareStoredFieldWithSortedNumericsDV(reader, "stored", "dv");
15501550
}
15511551
// merge some segments and ensure that at least one of them has more than
15521552
// 256 values
15531553
writer.forceMerge(numDocs / 256);
1554-
try (DirectoryReader reader = maybeWrapWithMergingReader(DirectoryReader.open(dir))) {
1554+
try (DirectoryReader reader = maybeWrapWithMergingReader(writer.getReader())) {
15551555
TestUtil.checkReader(reader);
15561556
compareStoredFieldWithSortedNumericsDV(reader, "stored", "dv");
15571557
}

0 commit comments

Comments
 (0)