lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: IndexWriter and IndexReader
Date Thu, 13 Feb 2014 17:27:09 GMT
Overwriting an index in-place while open IndexReaders are actively
searching works fine.

You can either open a new IW with OpenMode.CREATE, or, you can call
IW.deleteAll() if you have an existing IW already open.

Writing to a shared index directory mapped to N machines is not
generally done, because performance is often poor, though it should
work fine; usually apps replicate the index out to the N machines.
Lucene has a replication module that does this... but really if you
want to distribute load to N machines, you may want to just use Solr
or ElasticSearch, since they handle the replication / query load
balancing for you.

Mike McCandless

On Thu, Feb 13, 2014 at 10:54 AM, Cemo <> wrote:
> I am quite new to Lucene. I am trying to prepare an application where:
>    1. ~ 100K documents exist.
>    2. ~ 4 search server will be utilized
>    3. Documents are not frequently updated and I want to check every minute
>    a deletion or addition.
>    4. I am ready to sacrifice some system resource to keep my setup as
>    simple as possible
> Here are my questions:
>    1. I would like to create a single index folder and mapping this folder
>    to each server. Is this a good practice?
>    2. Instead of updating
>    (org.apache.lucene.index.IndexWriterConfig.OpenMode#CREATE_OR_APPEND) my
>    indexes, I want to overwrite them. Opening my indexes with
>    IndexWriterConfig.OpenMode.CREATE seems enough. I am considering that
>    SearcherFactory can warm and prepare my IndexReader for live system. Is
>    this a good way or am I totally in wrong direction?
>    3. During IndexWriter operations such as overwriting indexes, what are
>    the consequences of "searcherManager.acquire();"? I am afraid of having
>    some concurrency errors at live system under heavy load.
> Thanks

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message