lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murad James" <>
Subject Can I have an IndexWriter and an IndexReader open on the same index at the same time?
Date Thu, 19 Oct 2006 21:05:54 GMT
Hi - I have a query and I wonder if anyone can give me some pointers:

I am creating an index. I am adding information from rows in a database
to create a full text search. 

The database will be updated every day, so I want to remove the document
relating to a specific existing row from the database and add a new
document containing the updated row - I believe that this is the way it
needs to be done.

What is the best pattern for this?

For example, can I loop through the reader doing an
IndexReader.Delete(Term) and then an IndexWriter.Add(Document) without
closing the reader and writer each time - i.e. can they both be open at
once? This would just allow me to open everything in the constructor and
close it at the end.

Or, do I need to open / close / open / close each time?

Is my approach correct in the first place?

Any assistance gratefully received!


View raw message