diff --git a/changes.txt b/changes.txt old mode 100644 new mode 100755 index dcc5dccf8b..2f6990732a --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,9 @@ CHANGES +2013-05-30 +- Update Index\Status::getAliases() to use new API +- Update Index\Status::getSettings() to use new API + 2013-05-29 - Add _meta to mapping. #330 diff --git a/lib/Elastica/Index/Status.php b/lib/Elastica/Index/Status.php old mode 100644 new mode 100755 index 94a5077e69..6a3430254e --- a/lib/Elastica/Index/Status.php +++ b/lib/Elastica/Index/Status.php @@ -86,11 +86,8 @@ public function get() */ public function getAliases() { - // TODO Update as soon as new API is implemented - $cluster = new Cluster($this->_index->getClient()); - $state = $cluster->getState(); - - return $state['metadata']['indices'][$this->_index->getName()]['aliases']; + $responseData = $this->getIndex()->request('_aliases', \Elastica\Request::GET)->getData(); + return array_keys($responseData[$this->getIndex()->getName()]['aliases']); } /** @@ -100,11 +97,8 @@ public function getAliases() */ public function getSettings() { - // TODO Update as soon as new API is implemented - $cluster = new Cluster($this->_index->getClient()); - $state = $cluster->getState(); - - return $state['metadata']['indices'][$this->_index->getName()]['settings']; + $responseData = $this->getIndex()->request('_settings', \Elastica\Request::GET)->getData(); + return $responseData[$this->getIndex()->getName()]['settings']; } /**