mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gsing...@apache.org
Subject svn commit: r894869 - /lucene/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java
Date Thu, 31 Dec 2009 15:46:04 GMT
Author: gsingers
Date: Thu Dec 31 15:46:04 2009
New Revision: 894869

URL: http://svn.apache.org/viewvc?rev=894869&view=rev
Log:
MAHOUT-163: a little more cleanup

Modified:
    lucene/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java

Modified: lucene/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java?rev=894869&r1=894868&r2=894869&view=diff
==============================================================================
--- lucene/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java
(original)
+++ lucene/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java
Thu Dec 31 15:46:04 2009
@@ -31,6 +31,8 @@
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.index.TermEnum;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.util.OpenBitSet;
 import org.apache.mahout.common.CommandLineUtil;
 import org.apache.mahout.utils.clustering.ClusterDumper;
@@ -38,6 +40,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
@@ -170,13 +173,13 @@
   protected List<TermInfoClusterInOut> getClusterLabels(String clusterID, List<String>
ids) throws CorruptIndexException, IOException {
 
     if (ids.size() < minNumIds) {
-      log.info("Skipping small cluster " + clusterID);
+      log.info("Skipping small cluster " + clusterID + " with size: " + ids.size());
       return null;
     }
 
     log.info("Processing Cluster " + clusterID + " with " + ids.size() + " documents");
-
-    IndexReader reader = IndexReader.open(this.indexDir, false);
+    Directory dir = FSDirectory.open(new File(this.indexDir));
+    IndexReader reader = IndexReader.open(dir, false);
 
     log.info("# of documents in the index " + reader.numDocs());
 



Mime
View raw message