array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'solrclient.optimize.php', 1 => 'SolrClient::optimize', 2 => 'Defragments the index', ), 'up' => array ( 0 => 'class.solrclient.php', 1 => 'SolrClient', ), 'prev' => array ( 0 => 'solrclient.getoptions.php', 1 => 'SolrClient::getOptions', ), 'next' => array ( 0 => 'solrclient.ping.php', 1 => 'SolrClient::ping', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/solr/solrclient/optimize.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL solr >= 0.9.2)
SolrClient::optimize — Defragments the index
$maxSegments = 1, bool $softCommit = true, bool $waitSearcher = true): SolrUpdateResponseDefragments the index for faster search performance.
maxSegmentsOptimizes down to at most this number of segments. Since Solr 1.3
softCommitThis will refresh the 'view' of the index in a more performant manner, but without "on-disk" guarantees. (Solr4.0+)
waitSearcherBlock until a new searcher is opened and registered as the main query searcher, making the changes visible.
Returns a SolrUpdateResponse on success or throws an exception on failure.
Throws SolrClientException if the client had failed, or there was a connection issue.
Throws SolrServerException if the Solr Server had failed to process the request.
PECL Solr >= 2.0 only supports Solr Server >= 4.0
Prior to PECL Solr 2.0 this method used to accept these arguments "int $maxSegments, bool $waitFlush, bool $waitSearcher".