You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by Arun B C <bc...@yahoo.com.INVALID> on 2014/06/25 10:44:33 UTC

Near real time reader using ControlledRealTimeReopenThread

Hi General Group,

Am currently using Lucene 4.7.2.

I use DirectoryReader directoryreader = DirectoryReader.open(indexWriter, 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 http://stackoverflow.com/questions/17993960/lucene-4-4-0-new-controlledrealtimereopenthread-sample-usage. 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

Re: Near real time reader using ControlledRealTimeReopenThread

Posted by Michael McCandless <lu...@mikemccandless.com>.
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
ControlledRealTimeReopenThread...

Mike McCandless

http://blog.mikemccandless.com


On Wed, Jun 25, 2014 at 9:44 AM, Arun B C <bc...@yahoo.com.invalid> wrote:
> Hi General Group,
>
> Am currently using Lucene 4.7.2.
>
> I use DirectoryReader directoryreader = DirectoryReader.open(indexWriter, 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 http://stackoverflow.com/questions/17993960/lucene-4-4-0-new-controlledrealtimereopenthread-sample-usage. 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