Command.php
public function update($index, $type, $id, $data, $options = [])
    {
        $body = [
            'doc' => empty($data) ? new \stdClass() : $data,
        ];
        if (isset($options["detect_noop"])) {
            $body["detect_noop"] = $options["detect_noop"];
            unset($options["detect_noop"]);
        }

        return $this->db->post([$index, $type, $id, '_update'], $options, Json::encode($body));
    }
public function update($index, $type, $id, $data, $options = [])
    {
        $body = [
            'doc' => empty($data) ? new \stdClass() : $data,
        ];
        if (isset($options["detect_noop"])) {
            $body["detect_noop"] = $options["detect_noop"];
            unset($options["detect_noop"]);
        }

        return $this->db->post([$index, $type, $id, '_update'], $options, Json::encode($body));
    }
public function update ( $ index , $ type , $ id , $ data , $ options = [ ] ) { $ body = [ 'doc' => empty ( $ data ) ? new \ stdClass ( ) : $ data , ] ; if ( isset ( $ options [ "detect_noop" ] ) ) { $ body [ "detect_noop" ] = $ options [ "detect_noop" ] ; unset ( $ options [ "detect_noop" ] ) ; } return $ this -> db -> post ( [ $ index , $ type , $ id , '_update' ] , $ options , Json :: encode ( $ body ) ) ; }
updates a document
@param $index
@param $type
@param $id
@param array $options
@return mixed
@see http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html
updates a document