lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: IndexReader.deleteDocument(Term) in Lucene 3.6/4.0
Date Fri, 25 May 2012 12:59:58 GMT

On Fri, May 25, 2012 at 2:45 PM, Nikolay Zamosenchuk
<> wrote:
> Hi everyone. We are using IndexReader.deleteDocument(Term) method to
> delete documents, since it returns the number of deleted documents.
> This is used to be sure that some docs were removed. We must know for
> sure if documents were deleted. But in lucene 3.6 this method is final
> and can't be overridden in our codebase anymore. Method
> IndexWriter.deleteDocument(..) is not final and possibly can be used
> in our project, but doesn't return any value so we can't be sure
> whether ant documents were deleted. So briefly
> IndexReader.deleteDocument(Term) is a final but returns number of
> deletions performed and IndexWriter.deleteDocument(..) is not final,
> but doesn't return any result. Our functionality requires overriding
> and result value.
> Can anyone please suggest how to solve this issue? Can simply run term
> query before, but it seems to be absolutely inefficient.

what you can do is use IndexReader#docFreq(Term) to figure out
documents that have been deleted / will be deleted by you delete term

> --
> Best regards, Nikolay Zamosenchuk
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message