protected function Drupal_Apache_Solr_Service::setStats in Apache Solr Search 6
Same name and namespace in other branches
- 5.2 Drupal_Apache_Solr_Service.php \Drupal_Apache_Solr_Service::setStats()
- 6.2 Drupal_Apache_Solr_Service.php \Drupal_Apache_Solr_Service::setStats()
Sets $this->stats with the information about the Solr Core form /admin/stats.jsp
1 call to Drupal_Apache_Solr_Service::setStats()
- Drupal_Apache_Solr_Service::getStats in ./
Drupal_Apache_Solr_Service.php - Get information about the Solr Core.
File
- ./
Drupal_Apache_Solr_Service.php, line 90
Class
Code
protected function setStats() {
$data = $this
->getLuke();
// Only try to get stats if we have connected to the index.
if (empty($this->stats) && isset($data->index->numDocs)) {
$url = $this
->_constructUrl(self::STATS_SERVLET);
$this->stats_cid = "apachesolr:stats:" . md5($url);
$cache = cache_get($this->stats_cid, 'cache_apachesolr');
if (isset($cache->data)) {
$this->stats = simplexml_load_string($cache->data);
}
else {
$response = $this
->_sendRawGet($url);
$this->stats = simplexml_load_string($response
->getRawResponse());
cache_set($this->stats_cid, $response
->getRawResponse(), 'cache_apachesolr');
}
}
}