lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Serebrennikov <>
Subject RE: Question Deleting/Reindexing Files
Date Thu, 21 Mar 2002 17:48:40 GMT
>>[1] There's no update so delete and then add is what you want.
>>[2] I have had the same problems w/ using an IndexWriter and IndexReader
>>at the same time and getting a locking problem when deleting. I think I
>>mail to the list w/ a test case a week ago  [disclaimer: this is not
>>a complaint!] and I think the issue is still open. Maybe I should turn
>>into a bug report? I know fixing bugs is encourage but I don't have
>>context about the right solution, or how the locking apparently
>>changed to foul this up, though I did look thru things. 
>>My workaround was to write new entries to a new index and then run
>>a separate merge utility that 1st does a delete pass, and then reopens
>>and does adds, based on a "primary key" (the URL of each doc in my
>I think the locking issue is that the index directory is locked during 
>IndexWriter existance so that IndexReader cannot be created. However, 
>pre-existing IndexReaders should continue to work. Can you try to open 
>IndexReader before starting the adds and see if that allows you to do 
>the deletes?
>I like your workaround with a separate index. I think you might be able 
>to do one better by using IndexWriter.addIndexes(Directory[] dirs) 
>method to merge the additions from the new index directory into the old 
>one after the old docs are deleted from it. This should be faster and it 
>won't require that all of the data is in stored fields (I'm assuming 
>that in your case you restore the documents from the new index and 
>re-add them to the old one, and for this to work your docs must then 
>have all fields "stored" not simply "indexed").

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message