I am using the official Elasticsearch Javascript client with version 6.0 and trying to delete a list of indices.
The code is:
const client = new elasticsearch.Client({
"hosts": [
"https://the-es-host-here.us-west-2.es.amazonaws.com"
],
"apiVersion": "6.0",
"sniffOnStart": true
});
const indices = [
'enduser-2017-12-04',
'enduser-2017-12-08',
'enduser-2017-12-07',
'enduser-2017-12-01',
'enduser-2017-12-14',
'enduser-2017-12-10',
'enduser-2017-12-27',
'enduser-2017-12-02',
'enduser-2017-12-18',
'enduser-2017-12-22',
'enduser-2017-12-28',
'enduser-2017-12-09',
'enduser-2017-12-03',
'enduser-2017-12-05',
'enduser-2017-12-11',
'enduser-2017-11-29',
'enduser-2017-12-17',
'enduser-2017-12-15',
'enduser-2017-12-19'
];
client.indices.delete({
index: indices
}, (error) => {
if(error) {
console.error(error);
}
});
But none of the indexes are being deleted and I am seeing the following error:
Error: No Living connections
I don't see what I am doing wrong.