public function updateSettings()
    {

        if (!isset($this->params['index'])) {
                        throw new exceptions\RuntimeException("Index cannot be empty.");
        }

        $index = implode(',', $this->params['index']);

        $body = array("index" => $this->params['indexSettings']);

        $command = new Command();
        $command->index($index)
            ->id('_settings')
            ->action('put')
            ->data(json_encode($body, JSON_FORCE_OBJECT));

        $this->batch->clearCommands();
        $this->batch->addCommand($command);

        $ret = parent::execute();

        //clear out mappings, settings
        //$this->resetIndex();

        return $ret[0];

    }
public function updateSettings()
    {

        if (!isset($this->params['index'])) {
                        throw new exceptions\RuntimeException("Index cannot be empty.");
        }

        $index = implode(',', $this->params['index']);

        $body = array("index" => $this->params['indexSettings']);

        $command = new Command();
        $command->index($index)
            ->id('_settings')
            ->action('put')
            ->data(json_encode($body, JSON_FORCE_OBJECT));

        $this->batch->clearCommands();
        $this->batch->addCommand($command);

        $ret = parent::execute();

        //clear out mappings, settings
        //$this->resetIndex();

        return $ret[0];

    }
public function updateSettings ( ) { if ( ! isset ( $ this -> params [ 'index' ] ) ) { throw new exceptions \ RuntimeException ( "Index cannot be empty." ) ; } $ index = implode ( ',' , $ this -> params [ 'index' ] ) ; $ body = array ( "index" => $ this -> params [ 'indexSettings' ] ) ; $ command = new Command ( ) ; $ command -> index ( $ index ) -> id ( '_settings' ) -> action ( 'put' ) -> data ( json_encode ( $ body , JSON_FORCE_OBJECT ) ) ; $ this -> batch -> clearCommands ( ) ; $ this -> batch -> addCommand ( $ command ) ; $ ret = parent :: execute ( ) ; //clear out mappings, settings //$this->resetIndex(); return $ ret [ 0 ] ; }
Update the settings of an index

@todo allow updating settings of all indices

@return \Sherlock\responses\IndexResponse
@throws exceptions\RuntimeException
Update the settings of an index