lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioannis Cherouvim ...@eworx.gr>
Subject cannot delete cfs files on windows
Date Wed, 12 Mar 2008 15:50:47 GMT
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message