protected function _updateSearchIndex() { CM_Model_Location::createAggregation(); while (CM_Model_Location::getCreateAggregationInProgress($this->getServiceManager()->getDatabases()->getReadMaintenance())) { sleep(1); } $client = $this->getServiceManager()->getElasticsearch()->getClient(); $type = new CM_Elasticsearch_Type_Location($client); $searchIndexCli = new CM_Elasticsearch_Index_Cli(null, $this->_streamOutput, $this->_streamError); $searchIndexCli->create($type->getIndexName()); }