lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-lucene-sandbox/contributions/ant/src/main/org/apache/lucene/ant IndexTask.java
Date Sun, 22 Feb 2004 14:50:04 GMT
ehatcher    2004/02/22 06:50:04

  Modified:    contributions/ant/src/main/org/apache/lucene/ant
                        IndexTask.java
  Log:
  add support for compound index format when creating new index
  
  Revision  Changes    Path
  1.6       +14 -0     jakarta-lucene-sandbox/contributions/ant/src/main/org/apache/lucene/ant/IndexTask.java
  
  Index: IndexTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/ant/src/main/org/apache/lucene/ant/IndexTask.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IndexTask.java	22 Feb 2004 10:33:38 -0000	1.5
  +++ IndexTask.java	22 Feb 2004 14:50:04 -0000	1.6
  @@ -84,6 +84,8 @@
   
     private HandlerConfig handlerConfig;
   
  +  private boolean useCompoundIndex = true;
  +
   
     /**
      *  Creates new instance
  @@ -121,6 +123,14 @@
   
   
     /**
  +   * 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
      *
      *@param  classname  The new documentHandler value
  @@ -234,6 +244,10 @@
   
       IndexWriter writer =
         new IndexWriter(indexDir, analyzer, create);
  +
  +    if (create && useCompoundIndex) {
  +      writer.setUseCompoundFile(useCompoundIndex);
  +    }
       int totalFiles = 0;
       int totalIndexed = 0;
       int totalIgnored = 0;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message