lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward W. Rouse" <ero...@comsquared.com>
Subject RE: delete by docid in lucene 4
Date Thu, 12 Jul 2012 17:33:10 GMT
Constants.DEFAULT_ID_FIELD is the name of our unique documentId. The lucene
docId has no purpose for us as we consider it for internal use by lucene
only and use our own id for document tracking purposes.

> -----Original Message-----
> From: Sean Bridges [mailto:sean.bridges@gmail.com]
> Sent: Thursday, July 12, 2012 11:50 AM
> To: java-user@lucene.apache.org
> Subject: Re: delete by docid in lucene 4
> 
> Does that return a Term which matches the lucene docId?   What is the
> value of Constants.DEFAULT_ID_FIELD ?
> 
> Thanks,
> Sean
> 
> On Thu, Jul 12, 2012 at 6:54 AM, Edward W. Rouse
> <erouse@comsquared.com> wrote:
> > I get around this by creating an id based term like:
> >
> > new Term(Constants.DEFAULT_ID_FIELD, id)
> >
> >> -----Original Message-----
> >> From: Sean Bridges [mailto:sean.bridges@gmail.com]
> >> Sent: Wednesday, July 11, 2012 9:09 PM
> >> To: java-user@lucene.apache.org
> >> Subject: delete by docid in lucene 4
> >>
> >> Is it possible to delete by docId in lucene 4?  I can delete by
> docid
> >> in lucene 3 using IndexReader.deleteDocument(int docId), but that
> >> method is gone in lucene 4, and IndexWriter only allows deleting by
> >> Term or Query.
> >>
> >> This is our use case -  In our system, each document is identified
> by
> >> a unique serial id.  If an error occurs, we may index the same
> message
> >> multiple times.  When an index grows large enough, we stop adding to
> >> it, and optimize the index.  During optimization, if we see multiple
> >> docs with the same serialid, we delete all but the first, as all
> >> documents with the same serialid are the same.
> >>
> >> Thanks,
> >>
> >> Sean
> >>
> >> --------------------------------------------------------------------
> -
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


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