I'm looking for some clarification on the use of field cache in a real time index situation.
We are using Lucene in a real time fashion, but we update our reader via IndexReader.reopen() rather than using the IndexWriter.getReader(); After opening a new reader the old reader is closed. In the book Lucene in Action (2nd) it mentions something regarding since 2.9.2 you can pass in a subreader instead of the reader if you are reopening a reader so that you only have to load the new segment. But it is not clear on how all of this works. My big question is does doing it this way mean that I can reuse the portion of the cache that was created with prior readers? Or does the whole cache have to be rebuilt each time I do a reopen? I guess what I am asking is if in a real time situation, since I will be reopening readers regularly, is my cache constantly having to be rebuilt from scratch, or can I use this subreader approach to sequentially add to the cache? Also if the approach lets me sequentially add to the cache, how exactly do I go about dealing with the subreaders? All I have used before is my primary reader and as I perform a reopen, how do I know what subreader to pass into the fieldcache? Any info appreciated.