Hi ,
I need to delete some data based on time from a index. Using below qury I am able to get all the data.
curl -XGET 'http://abc6:9200/data*/_search?pretty' -H 'Content-Type: application/json' -d' { "query":{ "bool":{ "must":[ { "match_all":{} }, { "match_phrase":{ "cluster":{ "query":"abc" } } },{ "range":{ "event_time":{ "gte": "2020-03-02T00:00:00", "lte": "2020-03-02T23:59:59", "time_zone": "America/Los_Angeles", "format": "strict_date_optional_time" } } } ] }} }'
But my following Delete qeury not working , any idea ?
curl -XDELETE 'http://abc6:9200/data*/_delete' -d' { "query":{ "bool":{ "must":[ { "match_all":{} }, { "match_phrase":{ "cluster":{ "query":"abc" } } },{ "range":{ "event_time":{ "gte": "2020-03-02T00:00:00", "lte": "2020-03-02T23:59:59", "time_zone": "America/Los_Angeles", "format": "strict_date_optional_time" } } } ] }} }'
I am getting following error:
{"error":"Incorrect HTTP method for uri [/data*/_delete] and method [DELETE], allowed: [POST]","status":405}