🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

elasticsearch-deletebyquery

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-deletebyquery

elasticsearch deleteByQuery - back for those with the plugin installed

1.6.0
latest
Source
npm
Version published
Weekly downloads
642
-11.08%
Maintainers
1
Weekly downloads
 
Created
Source

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 = require('elasticsearch');
const deleteByQuery = require('elasticsearch-deletebyquery');

const client = new elasticsearch.Client({
  hosts, apiVersion,
  plugins: [ deleteByQuery ]
});

Example

Deleting documents with a simple query

client.deleteByQuery({
  index: 'myindex',
  q: 'test'
}, function (error, response) {
  // ...
});

Deleting documents using the Query DSL

client.deleteByQuery({
  index: 'posts',
  body: {
    query: {
      term: { published: false }
    }
  }
}, function (error, response) {
  // ...
});

Keywords

elasticsearch

FAQs

Package last updated on 25 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts