Eric Jain wrote:
More efficiently, yes. Easier, no.Currently, I use the following procedure to update an index incrementally:1. Build document 2. Open index reader 3. Delete any previous version of the document using a key field 4. Close index reader 5. Open index writer 6. Add document to index 7. Close index writer Repeat Any ideas how this could be accomplished more efficiently AND easier?
If you know you're going to update multiple documents, then the fastest approach is to batch things, e.g.:
1. Open reader;
2. Delete all old documents;
3. Close reader;
4. Open writer;
5. Add all new documents;
6. Close writer.
If, before step one, you open another IndexReader, then you can continue to use it for searches while the update is in progress. If you then, after step six, open a new IndexReader to use for searches, then no searches will ever see the intermediate state when documents have been deleted but not yet re-added.
Doug
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
