- Determine the number of segments to use for the manual optimization command
- Find the size of the core
du -h /var/cb/data/solr5/cbevents/<core_name>
- Divide the size in GB by 10 to get a suggested maxSegments value to try. Cores smaller than 200GB should be optimized to 10 segments.
- Manually optimize each core substituting <core_name> for the core name and <N> for the number of segments
curl 'http://localhost:8080/solr/<core_name>/update?optimize=true&maxSegments=<N>&waitFlush=false'
- If the optimization fails due to OutOfMemory exceptions, you can increase the maxSegments value and try step 2 again. If the optimization was successful, you can also try reducing the maxSegments and repeating step 2 again to try to further optimize the core on a second pass.