lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r358655 - /lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/IndexMergeTool.java
Date Thu, 22 Dec 2005 23:39:59 GMT
Author: dnaber
Date: Thu Dec 22 15:39:49 2005
New Revision: 358655

URL: http://svn.apache.org/viewcvs?rev=358655&view=rev
Log:
print usage if called with wrong number of arguments; be more verbose

Modified:
    lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/IndexMergeTool.java

Modified: lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/IndexMergeTool.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/IndexMergeTool.java?rev=358655&r1=358654&r2=358655&view=diff
==============================================================================
--- lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/IndexMergeTool.java
(original)
+++ lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/IndexMergeTool.java
Thu Dec 22 15:39:49 2005
@@ -70,6 +70,10 @@
  */
 public class IndexMergeTool {
   public static void main(String[] args) throws IOException {
+    if (args.length < 3) {
+      System.err.println("Usage: IndexMergeTool <mergedIndex> <index1> <index2>
[index3] ...");
+      System.exit(1);
+    }
     File mergedIndex = new File(args[0]);
 
     IndexWriter writer = new IndexWriter(mergedIndex, new  SimpleAnalyzer(), true);
@@ -79,9 +83,12 @@
       indexes[i  - 1] = FSDirectory.getDirectory(args[i], false);
     }
 
+    System.out.println("Merging...");
     writer.addIndexes(indexes);
 
+    System.out.println("Optimizing...");
     writer.optimize();
     writer.close();
+    System.out.println("Done.");
   }
 }



Mime
View raw message