First of all, thanks for the script. It is exactly what I was looking for.
I had to change it a little bit to make it compatible with ES7 though, since Version 7 deprecated the doc type.
I changed the
.put(`${baseUrl}/${index}/${type}/${id}/_create`)
to
.put(`${baseUrl}/${index}/_doc/${id}/_create`)
and removed the const type = 'emails'; line.
First of all, thanks for the script. It is exactly what I was looking for.
I had to change it a little bit to make it compatible with ES7 though, since Version 7 deprecated the doc type.
I changed the
to
and removed the
const type = 'emails';line.