Delete some data in index

Hello,
With Curl, how is it possible to remove a portion of an index data :

  • 1st case : any recording > on a date (use @timestamp column)
  • 2nd case : delete all records where the column test have the value "ok".

Thanks.

Depending on your version: delete by query plugin/feature could help.

Where can I download this plugin for offline installation ?
Thanks

As I said it depends on your version.

I have elasticsearch 2.3.2

Doc is here: https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html

If you need to install it offline, try the online mode with verbose option. It will print the URL which is used.
Use this URL to download the ZIP file. Then install it using:

bin/plugin install file:///path/to/zip

thanks!

How to install that plugin without down time of ES ???

In the doc, I don't understand the example.

DELETE /twitter/tweet/_query?q=user:kimchy

In my case, i have an index called "index_baie1" with a column called "prediction".
This column have some values : "yes", "no" .

I need to delete all records of the index where prediction=yes.
How can do it ?
I test:
DELETE /index_baie1/prediction/_query?q=prediction:yes

May be install it on one node. Start the node. Let shards replicate. Then close the old node. Install the plugin. Start the node... And so on for all nodes.

Like a rolling upgrade.

DELETE /index_baie1/prediction/_query?q=prediction:yes

Yes. Probably.
I'd prefer using the Query DSL though.

Something like:

DELETE /index_baie1/prediction/_query
{
  "query": {
    // Your query here
  }
}

It's work with core2 instead of tweet