src/Sherlock/requests/IndexRequest.php
public function updateMapping()
    {

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

        if (count($this->params['indexMappings']) > 1) {
                        throw new exceptions\RuntimeException("May only update one mapping at a time.");
        }

        if (!isset($this->params['type'])) {
                        throw new exceptions\RuntimeException("Type must be specified.");
        }

        if (count($this->params['type']) > 1) {
                        throw new exceptions\RuntimeException("Only one type may be updated at a time.");
        }

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

        $command = new Command();
        $command->index($index)
            ->type($this->params['type'][0])
            ->id('_mapping')
            ->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 updateMapping()
    {

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

        if (count($this->params['indexMappings']) > 1) {
                        throw new exceptions\RuntimeException("May only update one mapping at a time.");
        }

        if (!isset($this->params['type'])) {
                        throw new exceptions\RuntimeException("Type must be specified.");
        }

        if (count($this->params['type']) > 1) {
                        throw new exceptions\RuntimeException("Only one type may be updated at a time.");
        }

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

        $command = new Command();
        $command->index($index)
            ->type($this->params['type'][0])
            ->id('_mapping')
            ->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/add the Mapping of an index

@return \Sherlock\responses\IndexResponse
@throws exceptions\RuntimeException