Hello everybody.

I have a big index that will be stored in the FS. I have lots of
updates, insertions and deletions in the index, and I would like to
minimize the number of "phatom reads".

I ve seen in the wiki this link:

http://wiki.apache.org/jakarta-lucene/UpdatingAnIndex

So, what about my idea:

- A singleton SearchEngine
- SearchEngine has a IndexReader attribute, and _no_ index writer.
- When inserting a new Document, open a writer, writes, close and the
replace the old reader for a new one.
- When deleting, open a reader, delete, replace the older reader for
this opened reader.
- The update method deletes than inserts.
- When searching, use the attribute IndexReader

Now some questions:

Is it too bad to open/close a writer every time I write on the index?

What about opening a new IndexReader for each new search, instead of
keeping the IndexReader attribute?

Would it be a lot better to batch updates? I could have a stack of
documents to be updated, and I would only write to the indexes when
the documentsToBeUpdated.size() reaches a certain number.

thanks a lot.
--
Paulo Silveira
http://www.paulo.com.br/

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

Reply via email to