I have been attempting to use the https://www.npmjs.com/package/elasticsearch-deletebyquery package to delete documents using a query. However, I keep receiving a "Not found" error. Here is my code snippet:
client.deleteByQuery({
index: index,
type: type,
body: {
query: {
range: {
timeStamp: {
gte: "2016-03-05",
lt: "2016-03-06"
}
}
}
}
});
Upon execution, I receive the following response:
Elasticsearch TRACE: 2016-03-05T11:48:52Z
-> DELETE ... 9200/amazontest/pageRanktest/_query
{
"query": {
"range": {
"timeStamp": {
"gte": "2016-03-05",
"lt": "2016-03-06"
}
}
}
}
<- 404
{
"found": false,
"_index": "amazontest",
"_type": "pageRanktest",
"_id": "_query"
I am unsure of what may be causing this issue. Any assistance would be greatly appreciated.