lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: cannot delete cfs files on windows
Date Thu, 13 Mar 2008 11:57:56 GMT
Not sure why you can't close, but it's a bit suspicious that you are  
opening the IndexReader every time you do a search.  Can you explain a  
little more about your process?  When are you indexing, how often, etc.?

-Grant

On Mar 12, 2008, at 11:50 AM, Ioannis Cherouvim wrote:

> 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
>

--------------------------
Grant Ingersoll
http://www.lucenebootcamp.com
Next Training: April 7, 2008 at ApacheCon Europe in Amsterdam

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ






---------------------------------------------------------------------
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