public function update($id, array $fields = [], $script = null, array $params = [])
    {
        $body = array_filter(
            [
                'doc' => $fields,
                'script' => $script,
            ]
        );

        $params = array_merge(
            [
                'id' => $id,
                'index' => $this->getManager()->getIndexName(),
                'type' => $this->type,
                'body' => $body,
            ],
            $params
        );

        return $this->getManager()->getClient()->update($params);
    }
public function update($id, array $fields = [], $script = null, array $params = [])
    {
        $body = array_filter(
            [
                'doc' => $fields,
                'script' => $script,
            ]
        );

        $params = array_merge(
            [
                'id' => $id,
                'index' => $this->getManager()->getIndexName(),
                'type' => $this->type,
                'body' => $body,
            ],
            $params
        );

        return $this->getManager()->getClient()->update($params);
    }
public function update ( $ id , array $ fields = [ ] , $ script = null , array $ params = [ ] ) { $ body = array_filter ( [ 'doc' => $ fields , 'script' => $ script , ] ) ; $ params = array_merge ( [ 'id' => $ id , 'index' => $ this -> getManager ( ) -> getIndexName ( ) , 'type' => $ this -> type , 'body' => $ body , ] , $ params ) ; return $ this -> getManager ( ) -> getClient ( ) -> update ( $ params ) ; }
Partial document update.

@param string $id     Document id to update.
@param array  $fields Fields array to update.
@param string $script Groovy script to update fields.
@param array  $params Additional parameters to pass to the client.

@return array
Partial document update .