You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2018/03/15 12:41:55 UTC
lucene-solr:master: LUCENE-8200: Add dummy doc before forceMerge in
TestIndexWriter to force a new segment
Repository: lucene-solr
Updated Branches:
refs/heads/master dab739ae4 -> 12fc8c7ae
LUCENE-8200: Add dummy doc before forceMerge in TestIndexWriter to force a new segment
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/12fc8c7a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/12fc8c7a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/12fc8c7a
Branch: refs/heads/master
Commit: 12fc8c7ae0090ab4c1fee97000f17ecc8c250752
Parents: dab739a
Author: Simon Willnauer <si...@apache.org>
Authored: Thu Mar 15 13:41:09 2018 +0100
Committer: Simon Willnauer <si...@apache.org>
Committed: Thu Mar 15 13:41:09 2018 +0100
----------------------------------------------------------------------
lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/12fc8c7a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index 3f4c87f..a95a8e3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -3115,7 +3115,6 @@ public class TestIndexWriter extends LuceneTestCase {
Directory dir = newDirectory();
IndexWriterConfig indexWriterConfig = newIndexWriterConfig();
AtomicBoolean mergeAwaySoftDeletes = new AtomicBoolean(random().nextBoolean());
-
indexWriterConfig.setMergePolicy(new OneMergeWrappingMergePolicy(indexWriterConfig.getMergePolicy(), towrap ->
new MergePolicy.OneMerge(towrap.segments) {
@Override
@@ -3200,6 +3199,8 @@ public class TestIndexWriter extends LuceneTestCase {
}
}
mergeAwaySoftDeletes.set(true);
+ writer.addDocument(new Document()); // add a dummy doc to trigger a segment here
+ writer.flush();
writer.forceMerge(1);
DirectoryReader oldReader = reader;
reader = DirectoryReader.openIfChanged(reader, writer);