lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Near real time reader using ControlledRealTimeReopenThread
Date Thu, 26 Jun 2014 04:44:17 GMT
Don't call IndexWriter.commit with each added document.  Call it only
when you need to ensure durability (all index changes are written to
stable storage).

You spawn CRTRT, passing it your SearcherManager and IndexWriter, and
it periodically reopens for you, with methods to wait for a specific
indexing generation if a given search must be "real-time". See
Lucene's test cases for examples on how to use

Mike McCandless

On Wed, Jun 25, 2014 at 9:44 AM, Arun B C <> wrote:
> Hi General Group,
> Am currently using Lucene 4.7.2.
> I use DirectoryReader directoryreader =, true); to get
near real time reader. In order to manage directoryReader instance being shared in a multi-threaded
environment, People suggested to use NRTManager.
> But I dont find NRTManager anymore in version 4.7.2. I think it was replaced with ControlledRealTimeReopenThread.
> I am not able to find any information about Near real time in ControlledRealTimeReopenThread
java doc. I also found a sample provided by a person 'futuretelematics' in
It has indexWriter.commit in create and update index methods. Is that right, will it not slow
down search? or point me to a sample/information to achieve near real time search using apache
4.7.2 or later.
> Please do let me know if you require any other information.
> Thanks in advance.
> Br,
> Arun BC

View raw message