lib/Elastica/Index.php
public function updateByQuery($query, AbstractScript $script, array $options = [])
    {
        $query = Query::create($query)->getQuery();

        $endpoint = new UpdateByQuery();
        $body = ['query' => \is_array($query)
            ? $query
            : $query->toArray(), ];

        $body['script'] = $script->toArray()['script'];
        $endpoint->setBody($body);
        $endpoint->setParams($options);

        return $this->requestEndpoint($endpoint);
    }
public function updateByQuery($query, AbstractScript $script, array $options = [])
    {
        $query = Query::create($query)->getQuery();

        $endpoint = new UpdateByQuery();
        $body = ['query' => \is_array($query)
            ? $query
            : $query->toArray(), ];

        $body['script'] = $script->toArray()['script'];
        $endpoint->setBody($body);
        $endpoint->setParams($options);

        return $this->requestEndpoint($endpoint);
    }
public function updateByQuery ( $ query , AbstractScript $ script , array $ options = [ ] ) { $ query = Query :: create ( $ query ) -> getQuery ( ) ; $ endpoint = new UpdateByQuery ( ) ; $ body = [ 'query' => \ is_array ( $ query ) ? $ query : $ query -> toArray ( ) , ] ; $ body [ 'script' ] = $ script -> toArray ( ) [ 'script' ] ; $ endpoint -> setBody ( $ body ) ; $ endpoint -> setParams ( $ options ) ; return $ this -> requestEndpoint ( $ endpoint ) ; }
Update entries in the db based on a query.

@param \Elastica\Query|string|array $query   Query object or array
@param AbstractScript               $script  Script
@param array                        $options Optional params

@return \Elastica\Response

@see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html
Update entries in the db based on a query .