Because Lucene has to first find the segment that the specified
document is in, and this is done via IndexReaders, not IndexWriters.
More about this in the Lucene book.
Otis
--- Dror Matalon [EMAIL PROTECTED] wrote:
Which begs the question: why do you need to use an IndexReader rather
than
a synchronization
standpoint). Maybe Otis, Erik or Doug could suggest why this may or
may
not be a good idea.
-Reece
-Original Message-
From: Dror Matalon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 12:06 PM
To: Lucene Users List
Subject: Re: Reopen IndexWriter after delete
Otis Gospodnetic writes:
No, it is not safe. You should close the IndexWriter, then delete the
document and close IndexReader, and then get a new IndexWriter and
continue writing.
IIRC lucene takes care that you do so.
Locking prevents you from having an open IndexWriter and
modify the
Correct. write.lock is used for that.
Otis
--- Morus Walter [EMAIL PROTECTED] wrote:
Otis Gospodnetic writes:
No, it is not safe. You should close the IndexWriter, then delete
the
document and close IndexReader, and then get a new IndexWriter and
continue writing.
IIRC lucene
Which begs the question: why do you need to use an IndexReader rather
than an IndexWriter to delete an item?
On Tue, Nov 11, 2003 at 02:46:37PM -0800, Otis Gospodnetic wrote:
1). If I delete a term using an IndexReader, can I use an existing
IndexWriter to write to the index? Or do I need
]
Sent: Wednesday, November 12, 2003 12:06 PM
To: Lucene Users List
Subject: Re: Reopen IndexWriter after delete?
Which begs the question: why do you need to use an IndexReader rather
than an IndexWriter to delete an item?
On Tue, Nov 11, 2003 at 02:46:37PM -0800, Otis Gospodnetic wrote:
1). If I
Hi,
A couple questions...
1). If I delete a term using an IndexReader, can I use an existing
IndexWriter to write to the index? Or do I need to close and reopen the
IndexWriter?
2). Is it safe to call IndexReader.delete(term) while an IndexWriter is
writing? Or should I be synchronizing
1). If I delete a term using an IndexReader, can I use an existing
IndexWriter to write to the index? Or do I need to close and reopen
the IndexWriter?
No. You should close IndexWriter first, then open IndexReader, then
call delete, then close IndexReader, and then open a new IndexWriter.