You are here

public function SearchApiSolrConnection::getSolrVersion in Search API Solr 7

Gets the current solr version.

Return value

int 1, 3 or 4. Does not give a more detailed version, for that you need to use getSystemInfo().

Overrides SearchApiSolrConnectionInterface::getSolrVersion

3 calls to SearchApiSolrConnection::getSolrVersion()
SearchApiSolrConnection::getStatsSummary in includes/solr_connection.inc
Gets summary information about the Solr Core.
SearchApiSolrConnection::optimizeOrCommit in includes/solr_connection.inc
Sends a commit or optimize command to the Solr server.
SearchApiSolrConnection::setStats in includes/solr_connection.inc
Stores information about the Solr core in $this->stats.

File

includes/solr_connection.inc, line 392

Class

SearchApiSolrConnection
Represents a Solr server resource.

Code

public function getSolrVersion() {

  // Allow for overrides by the user.
  if (!empty($this->options['solr_version'])) {
    return $this->options['solr_version'];
  }
  $system_info = $this
    ->getSystemInfo();

  // Get our solr version number
  if (isset($system_info->lucene->{'solr-spec-version'})) {
    return (int) $system_info->lucene->{'solr-spec-version'};
  }
  return 0;
}