lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (Commented) (JIRA)" <>
Subject [jira] [Commented] (SOLR-3141) Deprecate OPTIMIZE command in Solr
Date Sun, 19 Feb 2012 16:10:37 GMT


Uwe Schindler commented on SOLR-3141:

I just repeat here, what Mike already posted on the Lucene issue:

Some quick googling uncovers depressing examples of over-optimizing:


That last one has this fun comment:

// Lucene recommends calling optimize upon completion of indexing writer.optimize();

Most of the above items also affect Solr. E.g. the first one (I know people from FIZ Karlsruhe
and Fedora) is really funny. Fedora GSearch calls optimze=true on every add of a single document
to Solr. I even know people using Solr and complained about GSearch because of this.

We can fix those horrible user-code bugs very fast by making optimize a no-op in Solr, they
all will appreciate that. I just repeat: Nobody's installation would break, it would just
get faster.

Some funny detail: With Lucene 3.x, search actuall gets faster with multiple segments if you
do parallel ExceutorService-based search (I still dont really recommend to use ExceutorService
on IndexSearcher...). On the other hand by executing the search on a non-optimized pre 2.9
index with no per segment search was really slower, as MultiTermsEnum and MultiDocsEnum was

With Lucene 3.x there is really no slowdown at all caused by multiple segments, as each segment
is searched on its own with no interaction and just the results added to same priority queue.
I agree, Solr has some problems with facetting, but people should use per-segment facetting
and not optimize, this would improve their installations immense (although the actual facetting
might get slower, but on the other hand FieldCaches can be reused, so it actually gets faster).
The current default is global facetting and (for most installations) "optimize on *every*
single item added" (see above links).
> Deprecate OPTIMIZE command in Solr
> ----------------------------------
>                 Key: SOLR-3141
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.5
>            Reporter: Jan H√łydahl
>              Labels: force, optimize
>             Fix For: 3.6
> Background: LUCENE-3454 renames optimize() as forceMerge(). Please read that issue first.
> Now that optimize() is rarely necessary anymore, and renamed in Lucene APIs, what should
be done with Solr's ancient optimize command?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message