lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <>
Subject Re: improve indexing speed with nomergepolicy
Date Thu, 07 Aug 2014 11:37:42 GMT
Using NoMergePolicy for online indexes is usually not recommended. You want
to use NoMP in case where you build an index in a batch job, then in the
end before the index is "published" you run a forceMerge or maybeMerge
(with a real MergePolicy).

For online indexes, i.e. indexes that are being searched while they are
updated, if you use NoMP you will accumulate many segments in the index.
This means higher resources consumption overall: file handles, RAM,
potentially disk space, and usually results in slower searches.

You may want to tweak the default MP's settings though, to not kick off a
merge unless there are a large number of segments in the index. E.g. the
default MP merges segments when there are 10 at the same level (i.e.
roughly the same size). You can increase that.

Also, do you use NRTCachingDirectory? It's usually recommended for NRT,
even with default MP, since the tiny segments are merged in-memory, and
your NRT reopens don't result in flushing new segments to disk.


On Thu, Aug 7, 2014 at 1:14 PM, Sascha Janz <> wrote:

> hi,
> i try to speed up our indexing process. we use SeacherManager with
> applydeletes to get near real time Reader.
> we have not really "much" incoming documents, but the documents must be
> updated from time to time and the amount of documents to be updated could
> be quite large.
> i tried some tests with NoMergePolicy and the indexing process was 25 %
> faster.
> so i think of a change in our code, to use NoMergePolicy for a specific
> time interval, when users are active and do a forceMerge(20) every night,
> which last about 2 - 5 minutes.
> is this a good idea? or will i perhaps get into trouble?
> Sascha
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message