lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lucifer Hammer" <>
Subject IndexReader.deleteDocument(int docid) equivalent in 2.1 IndexWriter?
Date Mon, 14 May 2007 20:03:32 GMT
I noticed that the API for Lucene 2.1+ includes a deleteDocuments(Term)
method in the IndexWriter.  I'd love to be able to change my application to
use it (we're constantly updating docs, which means opening/closing the
writer/reader each time we update a doc). I use complex queries to determine
which docs to delete.  Pre-2.1, I've just executed a search and then looped
through as the parameter to the IndexReader.deleteDocument().  I'm
trying to figure out how to do the same for Lucene 2.1.  Is there a way to
specify the internal docid as a term? (So I can call
IndexWriter.deleteDocuments(internalId)?  Otherwise, I was thinking of using
a hit collector to fetch just our external UID.

Thanks for any guidance.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message