Command.php
public function deleteByQuery($options = [])
    {
        if (!isset($this->queryParts['query'])) {
            throw new InvalidCallException('Can not call deleteByQuery when no query is given.');
        }
        $query = [
            'query' => $this->queryParts['query'],
        ];
        if (isset($this->queryParts['filter'])) {
            $query['filter'] = $this->queryParts['filter'];
        }
        $query = Json::encode($query);
        $url = [$this->index !== null ? $this->index : '_all'];
        if ($this->type !== null) {
            $url[] = $this->type;
        }
        $url[] = '_query';

        return $this->db->delete($url, array_merge($this->options, $options), $query);
    }
public function deleteByQuery($options = [])
    {
        if (!isset($this->queryParts['query'])) {
            throw new InvalidCallException('Can not call deleteByQuery when no query is given.');
        }
        $query = [
            'query' => $this->queryParts['query'],
        ];
        if (isset($this->queryParts['filter'])) {
            $query['filter'] = $this->queryParts['filter'];
        }
        $query = Json::encode($query);
        $url = [$this->index !== null ? $this->index : '_all'];
        if ($this->type !== null) {
            $url[] = $this->type;
        }
        $url[] = '_query';

        return $this->db->delete($url, array_merge($this->options, $options), $query);
    }
public function deleteByQuery ( $ options = [ ] ) { if ( ! isset ( $ this -> queryParts [ 'query' ] ) ) { throw new InvalidCallException ( 'Can not call deleteByQuery when no query is given.' ) ; } $ query = [ 'query' => $ this -> queryParts [ 'query' ] , ] ; if ( isset ( $ this -> queryParts [ 'filter' ] ) ) { $ query [ 'filter' ] = $ this -> queryParts [ 'filter' ] ; } $ query = Json :: encode ( $ query ) ; $ url = [ $ this -> index !== null ? $ this -> index : '_all' ] ; if ( $ this -> type !== null ) { $ url [ ] = $ this -> type ; } $ url [ ] = '_query' ; return $ this -> db -> delete ( $ url , array_merge ( $ this -> options , $ options ) , $ query ) ; }
Sends a request to the delete by query
@param array $options
@return mixed
Sends a request to the delete by query