Another option for this might be IndexWriter.updateDocument().

"Erick Erickson" <[EMAIL PROTECTED]> wrote on 18/03/2007 15:28:09:

> BTW, instead of searching with a query, it might be faster
> to use TermEnum on your unique field. If TermEnum finds
> a term like the one you're about to add, you already have
> the title and can either delete the one already in the index
> (see TermDocs) or just not add the current one....
>
> On 3/18/07, Otis Gospodnetic <[EMAIL PROTECTED]> wrote:
> >
> > Markus,
> > What you were thinking is fine - search and, if found, delete first,
then
> > add.  Lucene allows duplicate and offers no automated way for avoiding
them.
> >


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

Reply via email to