lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: No longer able to set merge factor since updating to Lucene 3.4
Date Sat, 22 Oct 2011 14:19:01 GMT
Hmm, this is because as of 3.2.0 the default MergePolicy is now
TieredMergePolicy.

But: if you pass Version.LUCENE_31 when you create the
IndexWriterConfig you should get the old default (LogMergePolicy) and
then IW.setMergeFactor should work.

But it's better to use TieredMergePolicy (it's able to pick better
merges), and instead set the merge settings directly on that class.
That class actually "splits" mergeFactor into two separate controls:
maxMergeAtOnce (how many segments to merge at a time) and
segmentsPerTier (how "aggressively" you need to merge -- bigger
numbers means merging is delayed but your index has more segments).

Mike McCandless

http://blog.mikemccandless.com

On Fri, Oct 21, 2011 at 12:55 PM, Paul Taylor <paul_t100@fastmail.fm> wrote:
> Hi upgraded from 3.1 to 3.4, now it is compliaing about deprecated method
>
> indexWriter.setMergeFactor();
>
> Saying it can only be used with the default LogMergePolicy ,but I never set
> the merge policy so shouldn't I be using the default anyway ?
>
> Paul
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message