You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by zh...@apache.org on 2024/04/15 13:56:57 UTC
(lucene) branch main updated: Fix test failure TestDocumentsImpl.testGetDocumentFields (#13303)
This is an automated email from the ASF dual-hosted git repository.
zhangchao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new dca87235bec Fix test failure TestDocumentsImpl.testGetDocumentFields (#13303)
dca87235bec is described below
commit dca87235beca790c38dea2d2b9b629bd38440b4f
Author: Zhang Chao <80...@qq.com>
AuthorDate: Mon Apr 15 21:56:51 2024 +0800
Fix test failure TestDocumentsImpl.testGetDocumentFields (#13303)
---
.../apache/lucene/luke/models/documents/DocumentsTestBase.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java
index f933817e8ca..681979ac806 100644
--- a/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java
+++ b/lucene/luke/src/test/org/apache/lucene/luke/models/documents/DocumentsTestBase.java
@@ -19,6 +19,7 @@ package org.apache.lucene.luke.models.documents;
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;
@@ -53,7 +54,13 @@ public abstract class DocumentsTestBase extends LuceneTestCase {
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);