src/Query.php
public function update($data, $_id = NULL)
    {

        if ($_id) {
            $this->_id = $_id;
        }

        $parameters = [
            "id" => $this->_id,
            "body" => ['doc' => $data],
            'client' => ['ignore' => $this->ignores]
        ];

        if ($index = $this->getIndex()) {
            $parameters["index"] = $index;
        }

        if ($type = $this->getType()) {
            $parameters["type"] = $type;
        }

        return (object)$this->connection->update($parameters);
    }
public function update($data, $_id = NULL)
    {

        if ($_id) {
            $this->_id = $_id;
        }

        $parameters = [
            "id" => $this->_id,
            "body" => ['doc' => $data],
            'client' => ['ignore' => $this->ignores]
        ];

        if ($index = $this->getIndex()) {
            $parameters["index"] = $index;
        }

        if ($type = $this->getType()) {
            $parameters["type"] = $type;
        }

        return (object)$this->connection->update($parameters);
    }
public function update ( $ data , $ _id = NULL ) { if ( $ _id ) { $ this -> _id = $ _id ; } $ parameters = [ "id" => $ this -> _id , "body" => [ 'doc' => $ data ] , 'client' => [ 'ignore' => $ this -> ignores ] ] ; if ( $ index = $ this -> getIndex ( ) ) { $ parameters [ "index" ] = $ index ; } if ( $ type = $ this -> getType ( ) ) { $ parameters [ "type" ] = $ type ; } return ( object ) $ this -> connection -> update ( $ parameters ) ; }
Update a document
@param      $data
@param null $_id
@return object
Update a document