You keep stating that you never need to close the IndexWriter. I don't believe this is the case, and you are possibly misleading people as to the extent of your patch.

Don't you need to close (or flush) to get the documents on disk, so a new IndexReader can find them? If not any documents added using your IndexWriter are not visible. If I open another IndexReader while the IndexWriter is open, I don't not have any deterministic way of knowing what should be available.



On Jul 9, 2006, at 11:25 PM, Ning Li wrote:

To clarify, higher level (application level) adds and deletes can be
managed at a lower level such that index readers and writers aren't
continually opened and closed.
...
The big question is, what kind of efficiencies do you get by putting
this functionallity in IndexWriter vs a higher level class that uses
IndexWriters and IndexReaders?  Unless there is a clear performance
win, I'd prefer leaving IndexWriter simpler.

I think Lucene wants to excel not only in performance and
functionality, but also in operability. Almost all the Lucene newbies
that I know went through this learning curve of realizing you have to
batch inserts and deletes to achieve good performance. For some of
them, this cannot be easily done in the application level. This patch
improves operability for all of them, and it provides performance
improvement for the later group of people.

Conceptually, it's a clean modification. IndexWriter (or
IndexModifier) uses IndexReader to delete, just as IndexWriter already
uses IndexReader to merge. IndexWriter uses the same write lock it
acquired in its constructor to add AND delete documents, so ideally,
you never need to close IndexWriter! I really think it's worth it. :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to