Reputation: 4265
I just want to know if I am on the right track with how I should architect my Lucene context in my application:
Let me know if I am on the right track. There is so much information about how to read and write, but not enough about using NRT and when to make commits properly.
Upvotes: 1
Views: 410
Reputation: 756
You are mostly on the right path, but in fact, you can share a single instance of your reader/searcher in all the application without constructing it.
Try to have an index reader/writer factory if you have multiple indexes to manage them and if you can afford it, try to keep in the same application the reader and the writer, so you can benefit of the NRT feature of Lucene.NET.
Also, check this wiki for NRT advices:
http://wiki.apache.org/lucene-java/NearRealtimeSearch
Upvotes: 1
Reputation: 873
I have been using almost the same exact architecture for awhile now, and I have found it to work fine. Instead of getting the reader from IndexWriter in step 3a, try using IndexReader.Reopen(). And in step 4, you can simply call Reopen() whenever IsCurrent() is false.
Upvotes: 1