mirror of https://github.com/apache/lucene.git
- Patch from case 23754:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23754 git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150130 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1381c24605
commit
3a80552bd0
|
@ -275,6 +275,16 @@ public class IndexWriter {
|
|||
*
|
||||
* <p>This must never be less than 2. The default value is 10.*/
|
||||
public int mergeFactor = 10;
|
||||
|
||||
/** Determines the minimal number of documents required before the buffered
|
||||
* in-memory documents are merging and a new Segment is created.
|
||||
* Since Documents are merged in a {@link org.apache.lucene.store.RAMDirectory},
|
||||
* large value gives faster indexing. At the same time, mergeFactor limits
|
||||
* the number of files open in a FSDirectory.
|
||||
*
|
||||
* <p> The default value is 10.*/
|
||||
public int minMergeDocs = 10;
|
||||
|
||||
|
||||
/** Determines the largest number of documents ever merged by addDocument().
|
||||
* Small values (e.g., less than 10,000) are best for interactive indexing,
|
||||
|
@ -375,7 +385,7 @@ public class IndexWriter {
|
|||
|
||||
/** Incremental segment merger. */
|
||||
private final void maybeMergeSegments() throws IOException {
|
||||
long targetMergeDocs = mergeFactor;
|
||||
long targetMergeDocs = minMergeDocs;
|
||||
while (targetMergeDocs <= maxMergeDocs) {
|
||||
// find segments smaller than current target size
|
||||
int minSegment = segmentInfos.size();
|
||||
|
|
Loading…
Reference in New Issue