Hello

I can index many times and delete the index files (manually). But if I search once, then the cfs file is locked and cannot be deleted. Subsequent indexings create new cfs files. Even if I undeploy the tomcat web application which holds the search code, the cfs file cannot be deleted.


O/S:
Windows XP


Code to index:
IndexWriter writer = new IndexWriter(
   PATH,
   new StandardAnalyzer(),
   true);

writer.addDocument(doc1);
writer.addDocument(doc2);
writer.addDocument(doc3);

writer.optimize();
writer.close();


Code to search:
Searcher searcher = null;
IndexReader indexReader = null;
try {
   indexReader = IndexReader.open(PATH);
   searcher = new IndexSearcher(indexReader);
   Hits hits = searcher.search(query);
   ...
} finally {
   searcher.close();
   indexReader.close();
}



Am I doing something wrong?

thanks,
Ioannis

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to