src/Query.php
public function script($script, $params = [])
    {

        $parameters = [
            "id" => $this->_id,
            "body" => [
                "script" => [
                    "inline" => $script,
                    "params" => $params
                ]
            ],
            '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 script($script, $params = [])
    {

        $parameters = [
            "id" => $this->_id,
            "body" => [
                "script" => [
                    "inline" => $script,
                    "params" => $params
                ]
            ],
            '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 script ( $ script , $ params = [ ] ) { $ parameters = [ "id" => $ this -> _id , "body" => [ "script" => [ "inline" => $ script , "params" => $ params ] ] , '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 by script
@param       $script
@param array $params
@return object
Update by script