Elastica\Index::removeAlias PHP Method

removeAlias() public method

Removes an alias pointing to the current index.
public removeAlias ( string $name ) : Response
$name string Alias name
return Response Response
    public function removeAlias($name)
    {
        $path = '_aliases';
        $data = ['actions' => [['remove' => ['index' => $this->getName(), 'alias' => $name]]]];
        return $this->getClient()->request($path, Request::POST, $data);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param ElasticIndex $oldIndex
  * @param ElasticIndex $newIndex
  */
 private function moveAliasBetweenIndices(ElasticIndex $oldIndex, ElasticIndex $newIndex)
 {
     $oldIndex->removeAlias(MappingCreator::ELASTIC_ALIAS);
     $newIndex->addAlias(MappingCreator::ELASTIC_ALIAS);
 }