Skip to content

Commit

Permalink
Fix test failure TestDocumentsImpl.testGetDocumentFields (#13303)
Browse files Browse the repository at this point in the history
  • Loading branch information
easyice committed Apr 15, 2024
1 parent 539ae3b commit fb97840
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.io.IOException;
import java.nio.file.Path;
import java.util.Random;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
Expand Down Expand Up @@ -53,7 +54,13 @@ protected void createIndex() throws IOException {
indexDir = createTempDir();

Directory dir = newFSDirectory(indexDir);
RandomIndexWriter writer = new RandomIndexWriter(random(), dir, new StandardAnalyzer());
Random r = random();
RandomIndexWriter writer =
new RandomIndexWriter(
r,
dir,
newIndexWriterConfig(r, new StandardAnalyzer())
.setMergePolicy(newMergePolicy(r, false)));

FieldType titleType = new FieldType();
titleType.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
Expand Down

0 comments on commit fb97840

Please sign in to comment.