src/Sherlock/requests/IndexDocumentRequest.php
public function execute()
    {

        /*
        foreach (array('index', 'type') as $key) {
            if (!isset($this->params[$key])) {
                                throw new exceptions\RuntimeException($key." cannot be empty.");
            }
        }

        foreach (array('index', 'type') as $key) {
            if (count($this->params[$key]) > 1) {
                                throw new exceptions\RuntimeException("Only one ".$key." may be inserted into at a time.");
            }
        }

        */


        $this->finalizeCurrentCommand();

        //if this is an internal Sherlock BatchCommand, make sure index/types/action are filled
        if ($this->batch instanceof BatchCommand) {
            if (isset($this->params['index'][0])) {
                $this->batch->fillIndex($this->params['index'][0]);
            }

            if (isset($this->params['type'][0])) {
                $this->batch->fillType($this->params['type'][0]);
            }

        }

        return parent::execute();
    }
public function execute()
    {

        /*
        foreach (array('index', 'type') as $key) {
            if (!isset($this->params[$key])) {
                                throw new exceptions\RuntimeException($key." cannot be empty.");
            }
        }

        foreach (array('index', 'type') as $key) {
            if (count($this->params[$key]) > 1) {
                                throw new exceptions\RuntimeException("Only one ".$key." may be inserted into at a time.");
            }
        }

        */


        $this->finalizeCurrentCommand();

        //if this is an internal Sherlock BatchCommand, make sure index/types/action are filled
        if ($this->batch instanceof BatchCommand) {
            if (isset($this->params['index'][0])) {
                $this->batch->fillIndex($this->params['index'][0]);
            }

            if (isset($this->params['type'][0])) {
                $this->batch->fillType($this->params['type'][0]);
            }

        }

        return parent::execute();
    }
Perform the indexing operation

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