On 5/4/2012 8:10 PM, Lance Norskog wrote:
Optimize takes a 'maxSegments' option. This tells it to stop when
there are N segments instead of just one.
If you use a very high mergeFactor and then call optimize with a sane
number like 50, it only merges the little teeny segments.
When I optimize, I want only one segment. My main concern in doing
occasional optimizes is removing deleted documents. Whatever speedup I
get from having only one segment is just a nice bonus.
When it comes to only merging the small segments, I am concerned about
that happening when regular indexing builds up enough segments to do a
merge. If I start with one large optimized segment, then do indexing
operations such that I reach segmentsPerTier, will it leave the large
segment alone and just work on the little ones? I am using Solr 3.5
with the following config:
<mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
<int name="maxMergeAtOnce">35</int>
<int name="segmentsPerTier">35</int>
<int name="maxMergeAtOnceExplicit">105</int>
</mergePolicy>
Thanks,
Shawn