You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by bu...@apache.org on 2004/09/08 17:31:29 UTC

DO NOT REPLY [Bug 31120] New: - Move IndexReader.delete functionality to IndexWriter

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31120>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31120

Move IndexReader.delete functionality to IndexWriter

           Summary: Move IndexReader.delete functionality to IndexWriter
           Product: Lucene
           Version: 1.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Index
        AssignedTo: lucene-dev@jakarta.apache.org
        ReportedBy: tilman.giese@gmx.de


I propose moving the functionality of deleting a document from the index from
IndexReader to IndexWriter, not only because because it is misleading that a
reader modifies the index, but also because of the following problem:

I have a website index, that should be updated but that should also be available
for searching while updating. So I open an IndexReader for searching the index
for a specific document and for deleting an outdated document from the index and
I open an IndexWriter to add updated documents to the index. But there is a
conflict between the locks of those two instances. If I want to update a
document, I have to close the IndexWriter (because otherwise IndexReader could
not obtain the lock for writing to the index) and the IndexReader (because it
would complain if the index was modified since opening the reader). Then I have
to create a new reader to delete the document from the index, and I have to
close this reader as it does not release the write lock after deleting a
document, so I would not be able to open an IndexWriter. And now I can open a
fresh IndexWriter for adding the new document again and a fresh IndexReader for
searching the index for the next document.

You see, in the worst case (every document has been modified) the program is
only opening and closing readers and writers all the time.

If the IndexWriter deleted documents from the index, only this instance would
need a write lock and I could only use one IndexReader and one IndexWriter for
updating the whole index.

If you know a better way to update the index, then let me know.

Tilman Giese

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org