lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Goller <>
Subject Re: Deleting a document with an IndexWriter open
Date Tue, 20 Jul 2004 12:37:11 GMT
Giulio Cesare Solaroli wrote:
> Hi all,
> I would like to submit a "think different" approach to this problem
> for evaluation for you developers.
> Would it be possible to just mark the relevant documents as "deleted"
> (instead of deleting them altogether) with an IndexWriter used for
> inserting new documents?
> "marking" a document as deleted would leave it on the index, but it
> would not include it in any result set.
> At a later time, an IndexReader could be opened to really delete all
> "marked" documents.
> Does this approach is compatible with Lucene architecture?

It´s already done in a quite similar fashion, but the roles of
IndexReader and IndexWriter are exchanged. If you call delete with
an IndexReader, the document(s) are only marked as deleted. You might
even call undeletAll to undo the deletion. It´s only with the next
explicit optimize or implicit merge from an IndexWriter that the
document(s) are irreversibly deleted.


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

View raw message