elasticsearch-deletebyquery
Elasticsearch-js client extension for the Delete-by-query plugin.
This module provides the deleteByQuery
method which was removed from the core API in ES 2.0.0. For those with the Delete-by-query installed, this will bring back that feature to your Elasticsearch-js client.
Setup
Install the package.
npm install --save elasticsearch-deletebyquery
Then extend the Elasticsearch API by including this plugin.
'use strict'; const hosts = '127.0.0.1';const apiVersion = '2.x';const elasticsearch = ;const deleteByQuery = ; const client = hosts apiVersion plugins: deleteByQuery ;
Example
Deleting documents with a simple query
client;
Deleting documents using the Query DSL
client;