With a mergeFactor set to anything > 1 you would never have only one segment - unless you optimized. So Lucene will never naturally merge all the segments into one. Unless, I suppose, the mergeFactor was set to 1, but I've never tested that. It's hard to picture how that would work.
If I understand correctly, the same actions occur (deleted documents are removed, etc.) because an optimize is only a multiway merge down to one segment, whereas normal merging is triggered by the mergeFactor, but does not have a "target" segment count to merge down to. -Jay On Sun, Feb 21, 2010 at 11:20 AM, David Smiley @MITRE.org <dsmi...@mitre.org > wrote: > > I've always thought that these two events were effectively equivalent. -- > the results of an optimize vs the results of Lucene _naturally_ merging all > segments together into one. If they don't have the safe effect then what > is > the difference? > > ~ David Smiley > > > Otis Gospodnetic wrote: > > > > Hello, > > > > Solr will never optimize the whole index without somebody explicitly > > asking for it. > > Lucene will merge index segments on the master as documents are indexed. > > How often it does that depends on mergeFactor. > > > > See: > > > http://search-lucene.com/?q=mergeFactor+segment+merge&fc_project=Lucene&fc_project=Solr&fc_type=mail+_hash_+user > > > > > > Otis ---- > > Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch > > Hadoop ecosystem search :: http://search-hadoop.com/ > > > > > > > > ----- Original Message ---- > >> From: mklprasad <mklpra...@gmail.com> > >> To: solr-user@lucene.apache.org > >> Sent: Fri, February 19, 2010 1:02:11 AM > >> Subject: Re: optimize is taking too much time > >> > >> > >> > >> > >> Jagdish Vasani-2 wrote: > >> > > >> > Hi, > >> > > >> > you should not optimize index after each insert of document.insted you > >> > should optimize it after inserting some good no of documents. > >> > because in optimize it will merge all segments to one according to > >> > setting > >> > of lucene index. > >> > > >> > thanks, > >> > Jagdish > >> > On Fri, Feb 12, 2010 at 4:01 PM, mklprasad wrote: > >> > > >> >> > >> >> hi > >> >> in my solr u have 1,42,45,223 records having some 50GB . > >> >> Now when iam loading a new record and when its trying optimize the > >> docs > >> >> its > >> >> taking 2 much memory and time > >> >> > >> >> > >> >> can any body please tell do we have any property in solr to get rid > of > >> >> this. > >> >> > >> >> Thanks in advance > >> >> > >> >> -- > >> >> View this message in context: > >> >> > >> > http://old.nabble.com/optimize-is-taking-too-much-time-tp27561570p27561570.html > >> >> Sent from the Solr - User mailing list archive at Nabble.com. > >> >> > >> >> > >> > > >> > > >> > >> Yes, > >> Thanks for reply > >> i have removed the optmize() from code. but i have a doubt .. > >> 1.Will mergefactor internally do any optmization (or) we have to > specify > >> > >> 2. Even if solr initaiates optmize if i have a large data like 52GB will > >> that takes huge time? > >> > >> Thanks, > >> Prasad > >> > >> > >> > >> -- > >> View this message in context: > >> > http://old.nabble.com/optimize-is-taking-too-much-time-tp27561570p27650028.html > >> Sent from the Solr - User mailing list archive at Nabble.com. > > > > > > > > -- > View this message in context: > http://old.nabble.com/optimize-is-taking-too-much-time-tp27561570p27676881.html > Sent from the Solr - User mailing list archive at Nabble.com. > >