src/Console/ElasticMigrateCommand.php
protected function createAliasForTargetIndex($name)
    {
        $targetIndex = $this->argument('target-index');

        if ($this->isAliasExists($name)) {
            $this->deleteAlias($name);
        }

        $payload = (new RawPayload())
            ->set('index', $targetIndex)
            ->set('name', $name)
            ->get();

        ElasticClient::indices()
            ->putAlias($payload);

        $this->info(sprintf(
            'The %s alias for the %s index was created.',
            $name,
            $targetIndex
        ));
    }
protected function createAliasForTargetIndex($name)
    {
        $targetIndex = $this->argument('target-index');

        if ($this->isAliasExists($name)) {
            $this->deleteAlias($name);
        }

        $payload = (new RawPayload())
            ->set('index', $targetIndex)
            ->set('name', $name)
            ->get();

        ElasticClient::indices()
            ->putAlias($payload);

        $this->info(sprintf(
            'The %s alias for the %s index was created.',
            $name,
            $targetIndex
        ));
    }
protected function createAliasForTargetIndex ( $ name ) { $ targetIndex = $ this -> argument ( 'target-index' ) ; if ( $ this -> isAliasExists ( $ name ) ) { $ this -> deleteAlias ( $ name ) ; } $ payload = ( new RawPayload ( ) ) -> set ( 'index' , $ targetIndex ) -> set ( 'name' , $ name ) -> get ( ) ; ElasticClient :: indices ( ) -> putAlias ( $ payload ) ; $ this -> info ( sprintf ( 'The %s alias for the %s index was created.' , $ name , $ targetIndex ) ) ; }
Create an alias for the target index.

@param string $name
@return void
Create an alias for the target index .