Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP.php deleteByQuery is error #77

Open
a316523235 opened this issue Oct 18, 2021 · 0 comments
Open

HTTP.php deleteByQuery is error #77

a316523235 opened this issue Oct 18, 2021 · 0 comments

Comments

@a316523235
Copy link

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']);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant