diff --git a/code/solr/SolrService.php b/code/solr/SolrService.php index e9ed3c9..814c661 100644 --- a/code/solr/SolrService.php +++ b/code/solr/SolrService.php @@ -4,6 +4,9 @@ Solr::include_client_api(); class SolrService extends Apache_Solr_Service { + /** + * @return Apache_Solr_Response + */ protected function coreCommand($command, $core, $params=array()) { $command = strtoupper($command); @@ -13,22 +16,31 @@ class SolrService extends Apache_Solr_Service { return $this->_sendRawGet($this->_constructUrl('admin/cores', $params)); } + /** + * @return boolean + */ public function coreIsActive($core) { $result = $this->coreCommand('STATUS', $core); return isset($result->status->$core->uptime); } + /** + * @return Apache_Solr_Response + */ public function coreCreate($core, $instancedir, $config=null, $schema=null, $datadir=null) { $args = array('instanceDir' => $instancedir); if ($config) $args['config'] = $config; if ($schema) $args['schema'] = $schema; if ($datadir) $args['dataDir'] = $datadir; - $this->coreCommand('CREATE', $core, $args); + return $this->coreCommand('CREATE', $core, $args); } + /** + * @return Apache_Solr_Response + */ public function coreReload($core) { - $this->coreCommand('RELOAD', $core); + return $this->coreCommand('RELOAD', $core); } protected $_serviceCache = array();