Skip to content

Commit

Permalink
Add no merge policy in test to avoid index merge
Browse files Browse the repository at this point in the history
Signed-off-by: Sandesh Kumar <[email protected]>
  • Loading branch information
sandeshkr419 committed Mar 13, 2024
1 parent 77a1193 commit ec43517
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.index.NoMergePolicy;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.DocValuesFieldExistsQuery;
import org.apache.lucene.search.IndexSearcher;
Expand Down Expand Up @@ -345,7 +346,13 @@ private void testSimple(
final int expectedCollectCount
) throws Exception {
try (Directory directory = newDirectory()) {
try (RandomIndexWriter indexWriter = new RandomIndexWriter(random(), directory)) {
try (
RandomIndexWriter indexWriter = new RandomIndexWriter(
random(),
directory,
newIndexWriterConfig().setMergePolicy(NoMergePolicy.INSTANCE)
)
) {
Document document = new Document();
addFieldConsumer.apply(document, "string", "a");
addFieldConsumer.apply(document, "string", "b");
Expand Down

0 comments on commit ec43517

Please sign in to comment.