Elastica\Cluster::getIndexNames PHP Method

getIndexNames() public method

Return list of index names.
public getIndexNames ( ) : array
return array List of index names
    public function getIndexNames()
    {
        return array_keys($this->_data['metadata']['indices']);
    }

Usage Example

示例#1
0
文件: Index.php 项目: kskod/Elastica
 /**
  * Checks if the given index is already created
  *
  * @return bool True if index exists
  */
 public function exists()
 {
     $cluster = new Cluster($this->getClient());
     return in_array($this->getName(), $cluster->getIndexNames());
 }