You are here

function _get_solr_instance in Apache Solr Attachments 5

Get a reference to the Solr service. This consolidates cal to varaible_get, etc.

2 calls to _get_solr_instance()
_asa_get_solr_instance in ./apachesolr_attachments.module
Get a reference to the Solr service.
_asa_remove_attachments_from_index in ./apachesolr_attachments.module
For a particular node id, remove all file attachments from the solr index.

File

./apachesolr_attachments.module, line 334
Provides a file attachment search implementation for use with the Apache Solr module

Code

function _get_solr_instance() {
  $host = variable_get('apachesolr_host', 'localhost');
  $port = variable_get('apachesolr_port', 8983);
  $path = variable_get('apachesolr_path', '/solr');
  $solr =& apachesolr_get_solr($host, $port, $path);
  if (!$solr
    ->ping()) {
    throw new Exception(t('No Solr instance available'));
  }
  return $solr;
}