You are here

public function SearchApiSolrConnection::optimize in Search API Solr 7

Sends an optimize command to the Solr server.

Will be synchronous unless $waitSearcher is set to FALSE.

Parameters

bool $waitSearcher: (optional) Wait until a new searcher is opened and registered as the main query searcher, making the changes visible. Defaults to true.

int|false $timeout: Seconds to wait until timing out with an exception. Defaults to an hour.

Return value

object A response object.

Throws

SearchApiException If an error occurs during the service call.

Overrides SearchApiSolrConnectionInterface::optimize

File

includes/solr_connection.inc, line 840

Class

SearchApiSolrConnection
Represents a Solr server resource.

Code

public function optimize($waitSearcher = TRUE, $timeout = 3600) {
  return $this
    ->optimizeOrCommit('optimize', $waitSearcher, $timeout);
}