You must create an IndexWriter, then create a {@link NRTManager.TrackingIndexWriter} from it, and pass that to theNRTManager. You may want to create two NRTManagers, once that always applies deletes on refresh and one that does not. In this case you should use a single {@link NRTManager.TrackingIndexWriter} instance for both.
Then, use {@link #acquire} to obtain the{@link IndexSearcher}, and {@link #release} (ideally,from within a finally
clause) to release it.
NOTE: to use this class, you must call {@link #maybeRefresh()}periodically. The {@link NRTManagerReopenThread} is asimple class to do this on a periodic basis, and reopens more quickly if a request is waiting. If you implement your own reopener, be sure to call {@link #addWaitingListener} so your reopener is notified when acaller is waiting for a specific generation searcher.
@see SearcherFactory @lucene.experimental
|
|
|
|
|
|