Skip to content

Commit

Permalink
Increased number of indexed docs to match segment count
Browse files Browse the repository at this point in the history
Signed-off-by: expani <[email protected]>
  • Loading branch information
expani committed Dec 24, 2024
1 parent a74e65e commit b5ae870
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,19 @@ public void testMergeSegmentsOnCommitDefault() throws Exception {
segments = engine.segments(true);
assertThat(segments.size(), equalTo(1));

ParsedDocument doc2 = testParsedDocument("2", null, testDocumentWithTextField(), B_2, null);
engine.index(indexForDoc(doc2));
engine.refresh("test");
ParsedDocument doc3 = testParsedDocument("3", null, testDocumentWithTextField(), B_3, null);
engine.index(indexForDoc(doc3));
engine.refresh("test");
// Fails for [2,3] in Lucene 10 due to changes in TieredMergePolicy https://github.com/apache/lucene/pull/266
// causing 3 documents to be merged within one segment.
for (int i = 2; i <= 4; i++) {
ParsedDocument document = testParsedDocument(
String.valueOf(i),
null,
testDocumentWithTextField(),
new BytesArray(new byte[] { (byte) i }),
null
);
engine.index(indexForDoc(document));
engine.refresh("test");
}

segments = engine.segments(true);
assertThat(segments.size(), equalTo(2));
Expand Down

0 comments on commit b5ae870

Please sign in to comment.