mirror of https://github.com/apache/lucene.git
add support for compound index format when creating new index
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150952 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3283c40205
commit
48fa83e2ac
|
@ -84,6 +84,8 @@ public class IndexTask extends Task {
|
||||||
|
|
||||||
private HandlerConfig handlerConfig;
|
private HandlerConfig handlerConfig;
|
||||||
|
|
||||||
|
private boolean useCompoundIndex = true;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new instance
|
* Creates new instance
|
||||||
|
@ -120,6 +122,14 @@ public class IndexTask extends Task {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If creating a new index and this is set to true, the
|
||||||
|
* index will be created in compound format.
|
||||||
|
*/
|
||||||
|
public void setUseCompoundIndex(boolean useCompoundIndex) {
|
||||||
|
this.useCompoundIndex = useCompoundIndex;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the documentHandler attribute of the IndexTask object
|
* Sets the documentHandler attribute of the IndexTask object
|
||||||
*
|
*
|
||||||
|
@ -234,6 +244,10 @@ public class IndexTask extends Task {
|
||||||
|
|
||||||
IndexWriter writer =
|
IndexWriter writer =
|
||||||
new IndexWriter(indexDir, analyzer, create);
|
new IndexWriter(indexDir, analyzer, create);
|
||||||
|
|
||||||
|
if (create && useCompoundIndex) {
|
||||||
|
writer.setUseCompoundFile(useCompoundIndex);
|
||||||
|
}
|
||||||
int totalFiles = 0;
|
int totalFiles = 0;
|
||||||
int totalIndexed = 0;
|
int totalIndexed = 0;
|
||||||
int totalIgnored = 0;
|
int totalIgnored = 0;
|
||||||
|
|
Loading…
Reference in New Issue