lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Optimising segments merges
Date Tue, 20 Sep 2016 21:39:14 GMT
Lucene takes care of merging ("natural merging") as you add documents,
commit, etc.

If your index is still going to be changing it's best to never
forceMerge and let natural merging run at its defaults.

And, yes, deleted documents are reclaimed by merging.

Mike McCandless

On Tue, Sep 20, 2016 at 4:16 PM, lukes <> wrote:
> Hi,
>  In my application i am committing(indexWriter.commit() on every
> single/batch of documents, but now as a result there are lots of segments
> getting generated(One thing can be, i don't do commit, but just add document
> to indexWriter. But now, if system crashes then uncommited documents
> wouldn't make. Please correct me if i am wrong). I can call forceMerge(say
> 5) after every n number of days. Would that be good approach ? As per i
> know, Lucene under the hoods doesn't do segments merge automatically, is
> there a property which can take care of this ?
>  Also, merge will take care of deleted documents(freeing up disk space) ?
> Regards.
> --
> View this message in context:
> Sent from the Lucene - Java Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message