How to delete document matching a query using official elasticsearch nodejs client?

Rolando

I want to perform a delete-by-query, specifically delete all documents that have a field Kname that contains Gary. I am using the latest version of elasticsearch (2.3) I am using the official ES client:

elasticsearch-js

How can I perform such a deletion? Is it not supported? If not, appreciate any code/alternatives.

Val

Since you are on ES 2.x, delete-by-query is now a plugin, so you need to install it first and then also require the deleteByQuery extension library for the Javascript client.

Then you can perform

    client.deleteByQuery({
        index: 'test',
        type: 'something',
        body: {
           query: {
               match: { Kname: 'gary' }
           }
        }
    }, function (error, response) {
        console.log(response);
    });

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to delete document matching a query using official elasticsearch nodejs client?

From Dev

Query for : How many elements of an array are matching in a document attribute in ElasticSearch

From Dev

Elasticsearch 2.1: how to delete by query using curl

From Dev

how do i issue a raw query using the java client in elasticsearch?

From Dev

Elasticsearch - Check if document is contained in query using synonyms

From Dev

elasticsearch generate query using resthighlevel client

From Dev

Delete the document in elasticsearch

From Dev

Elasticsearch 2.0: how to delete by query in Java

From Dev

How to update a document based on query using elasticsearch-js (or other means)?

From Dev

How to update a document based on query using elasticsearch-js (or other means)?

From Dev

Elasticsearch update document with matching id

From Dev

How do I add a post_filter to an ElasticSearch query using C# NEST client?

From Dev

How to update a document using elasticsearch-py?

From Dev

How can a Elasticsearch client be notified of a new indexed document?

From Dev

ElasticSearch Jest client, how to return document id from hit?

From Dev

How to delete document from MongoDB using Mongoengine?

From Dev

Elasticsearch Delete Query By Date

From Dev

Delete elasticsearch records by query

From Dev

Elasticsearch query on inner list and get only matching objects from list instead of entire list in result document

From Dev

How to sort by _doc using elasticsearch java client

From Java

Elasticsearch : How to delete an Index using python

From Dev

How to delete document from mongoDB collection using the document's ID?

From Dev

how to download pdf using NodeJS and send it to the client?

From Dev

How to delete an entity from AppEngine datastore that matching a query?

From Dev

Elasticsearch Multiple Prefix query OR Matching

From Dev

How to write date range query in Nest ElasticSearch client?

From Dev

Elasticsearch: document size and query performance

From Dev

elasticsearch - find document by exactly matching a nested object

From Dev

docker: how-to install elasticsearch delete-by-query

Related Related

  1. 1

    How to delete document matching a query using official elasticsearch nodejs client?

  2. 2

    Query for : How many elements of an array are matching in a document attribute in ElasticSearch

  3. 3

    Elasticsearch 2.1: how to delete by query using curl

  4. 4

    how do i issue a raw query using the java client in elasticsearch?

  5. 5

    Elasticsearch - Check if document is contained in query using synonyms

  6. 6

    elasticsearch generate query using resthighlevel client

  7. 7

    Delete the document in elasticsearch

  8. 8

    Elasticsearch 2.0: how to delete by query in Java

  9. 9

    How to update a document based on query using elasticsearch-js (or other means)?

  10. 10

    How to update a document based on query using elasticsearch-js (or other means)?

  11. 11

    Elasticsearch update document with matching id

  12. 12

    How do I add a post_filter to an ElasticSearch query using C# NEST client?

  13. 13

    How to update a document using elasticsearch-py?

  14. 14

    How can a Elasticsearch client be notified of a new indexed document?

  15. 15

    ElasticSearch Jest client, how to return document id from hit?

  16. 16

    How to delete document from MongoDB using Mongoengine?

  17. 17

    Elasticsearch Delete Query By Date

  18. 18

    Delete elasticsearch records by query

  19. 19

    Elasticsearch query on inner list and get only matching objects from list instead of entire list in result document

  20. 20

    How to sort by _doc using elasticsearch java client

  21. 21

    Elasticsearch : How to delete an Index using python

  22. 22

    How to delete document from mongoDB collection using the document's ID?

  23. 23

    how to download pdf using NodeJS and send it to the client?

  24. 24

    How to delete an entity from AppEngine datastore that matching a query?

  25. 25

    Elasticsearch Multiple Prefix query OR Matching

  26. 26

    How to write date range query in Nest ElasticSearch client?

  27. 27

    Elasticsearch: document size and query performance

  28. 28

    elasticsearch - find document by exactly matching a nested object

  29. 29

    docker: how-to install elasticsearch delete-by-query

HotTag

Archive