fix gratuitous open file handles bug
authorjohn <john>
Thu, 10 Mar 2005 19:12:53 +0000 (19:12 +0000)
committerjohn <john>
Thu, 10 Mar 2005 19:12:53 +0000 (19:12 +0000)
source/mircoders/servlet/ServletModuleOpenIndy.java

index 2ec9ec2..3470948 100755 (executable)
@@ -107,6 +107,7 @@ import org.apache.commons.net.smtp.SMTPReply;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.Hits;
 import org.apache.lucene.search.IndexSearcher;
@@ -120,7 +121,7 @@ import org.apache.lucene.search.Searcher;
  *    open-postings to the newswire
  *
  * @author mir-coders group
- * @version $Id: ServletModuleOpenIndy.java,v 1.89.2.15 2005/02/10 16:22:27 rhindes Exp $
+ * @version $Id: ServletModuleOpenIndy.java,v 1.89.2.16 2005/03/10 19:12:53 john Exp $
  *
  */
 
@@ -844,8 +845,9 @@ public class ServletModuleOpenIndy extends ServletModule
           else {
             try {
               Searcher searcher = null;
+             
               try {
-                searcher = new IndexSearcher(IndexReader.open(indexFile));
+                searcher = new IndexSearcher(FSDirectory.getDirectory(indexFile,false));
               }
               catch (IOException e) {
                 logger.debug("Can't open indexPath: " + indexFile.getAbsolutePath());