lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilton, Reece" <Reece.Wil...@dig.com>
Subject RE: Advice on updating an index?
Date Mon, 21 Jul 2003 17:45:14 GMT
Thanks Ype.  What do you mean by multiple documents?  Do you mean
multiple indexes?

Or do you mean, delete several documents from the index and then add the
new copies of them.  And then get the next batch of new documents.

-----Original Message-----
From: Ype Kingma [mailto:ykingma@xs4all.nl] 
Sent: Saturday, July 12, 2003 10:19 AM
To: Lucene Users List; Wilton, Reece
Subject: Re: Advice on updating an index?


Reece,

On Friday 11 July 2003 16:05, Wilton, Reece wrote:
> Hi,
>
> I'm having a bit of trouble figuring out the logic for deleting 
> documents from an index.  Any advice is appreciated!

<snip 75% of the experiments>

> 4) I created an index with an IndexWriter and then optimized it and 
> closed it. For each document:
> - I create a new IndexReader, delete the document and close the
> IndexReader
> - I create a new IndexWriter, add the document and close the
IndexWriter
> At the end I open the index with an IndexWriter and then optimize it
and
> close it.
>
> This works!  But it is pretty slow (compared to the other three 
> tests). Is this the best way of doing this?

AFAIK, yes.
You can speed this up by using multiple documents, ie. use
a document set.
Also, you don't need to close the index writer before optimizing.

One variation: you might leave the IndexReader open in case you need it
for searching, but I wouldn't recommend that under Windows because there
an open file cannot be deleted from a directory. Lucene deletes such
files during later optimizations.

Kind regards,
Ype

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message