Patrick,
I also have to deal with the issue of duplicate
entries and I've found the use of the
IndexReader.TermDocs(Term) function invaluable toward
this goal. It was far easier function to use than
IndexSearcher.Search, which in my experience has
sometimes returned unexpected results, though I blame
the Analyzer I was using more than the IndexSearcher
itself. Of course, as Michael stated, this is only a
viable option if your documents have a field with a
unique id.
Sincerely,
Dave
--- Michael Garski <[EMAIL PROTECTED]> wrote:
> Patrick,
>
> There is nothing built into Lucene to ensure that a
> given document is
> only in the index once, it is up to your application
> to provide that
> logic. If I need to ensure that I do not add a
> document to the index
> that is already present, I first perform a search
> against a field that
> is used to denote a unique document, such as an
> integer id.
>
> Michael
>
> Patrick Burrows wrote:
> > Is there anything built into DotLucene that will
> handle duplicate
> > entries?
> > While I am going to do my best to make sure there
> are no duplicates,
> > there
> > may be a case where I am unsure if a transaction
> completed (such as a
> > disk
> > full situation, maybe) and I might want to re-add
> a certain number of
> > items
> > just to make sure they are in there.
> >
> > If there isn't something built in, is there a
> strategy others have
> > used to
> > handle this?
> >
> > Thanks.
> >
>
>
____________________________________________________________________________________Choose
the right car based on your needs. Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/