# elasticsearch-deletebyquery

> elasticsearch deleteByQuery - back for those with the plugin installed

Latest version **1.6.0** (published 2015-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install elasticsearch-deletebyquery
pnpm add elasticsearch-deletebyquery
yarn add elasticsearch-deletebyquery
bun add elasticsearch-deletebyquery
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2015-11-25 |
| First published | 2015-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Danny Graham |
| Maintainers | dermidgen |
| Keywords | elasticsearch, client, plugin, deletebyquery |

## Links

- npm: https://www.npmjs.com/package/elasticsearch-deletebyquery
- Repository: https://github.com/dermidgen/elasticsearch-deletebyquery
- Homepage: https://github.com/dermidgen/elasticsearch-deletebyquery#readme
- Issues: https://github.com/dermidgen/elasticsearch-deletebyquery/issues
- npm.io page: https://npm.io/package/elasticsearch-deletebyquery

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.6.0 (latest) — 2015-11-25

## README

# [elasticsearch](https://github.com/elastic/elasticsearch-js)-deletebyquery

> Elasticsearch-js client extension for the [Delete-by-query](https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html) 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](https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html) 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.

```js
'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
```js
client.deleteByQuery({
  index: 'myindex',
  q: 'test'
}, function (error, response) {
  // ...
});
```

Deleting documents using the Query DSL
```js
client.deleteByQuery({
  index: 'posts',
  body: {
    query: {
      term: { published: false }
    }
  }
}, function (error, response) {
  // ...
});
```

---
_Source: https://npm.io/package/elasticsearch-deletebyquery · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
