Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcemerge function in Indexwriter class

I wanted to know about a function in Solr3.5.0 in the IndexWriter class. can anyone let me know what exactly the forceMerge() function does. Does it optimize the segments?

Thanks,

Jeyaprakash

like image 832
jeyaprakash Avatar asked Feb 25 '26 11:02

jeyaprakash


1 Answers

Yes, forceMerge is the successor of optimize. There are two main reasons for this renaming:

  • Lucene multi-segment performance has increased a lot over the last years,
  • Giving a less cool name to this method will prevent users from thinking that this method does some kind of magic and that any index is sub-optimal until this method has been called.

You can read more about this renaming at https://issues.apache.org/jira/browse/LUCENE-3454

like image 142
jpountz Avatar answered Feb 27 '26 03:02

jpountz