elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

HTTP.php deleteByQuery is error

Open a316523235 opened this issue 2 years ago • 0 comments

hello, deleteByQuery http method is 'POST', uri use '_delete_by_query' url eg: 192.168.1.10:9200/testdoc/g/_delete_by_query

right:

public function deleteByQuery($query, array $options = array())
    {
        $options += array(
            'refresh' => true
        );
        if (is_array($query)) {
            /**
             * Array implies using the JSON query DSL
             */
            $url = $this->buildUrl(array($this->type, "_delete_by_query"));
            $result = $this->call($url, "POST", $query);
        } elseif (is_string($query)) {
            /**
             * String based search means http query string search
             */
            $url = $this->buildUrl(array($this->type, "_delete_by_query"), array('q' => $query));
            $result = $this->call($url, "POST");
        }
        if ($options['refresh']) {
            $this->request('_refresh', "POST");
        }
        return !isset($result['error']);
    }

a316523235 avatar Oct 18 '21 07:10 a316523235