Delete by query with dynamic values

Hi all,

And wondering if I could do something like:

curl -XDELETE 'http://localhost:9200/my_index/my_type/_query?
q=creationDate:[* TO now-interval]'

in which "now" should dynamically represent the timestamp of query
execution and "interval" a date like "1d".

With this, I want to implement a process that executes a delete by
query of all documents in which creationDate is 1 day older than the-
moment-of-query-execution (kinda aging).

Thanks in advance!

Have a look at TimeToLive:

I think date math like in Solr is not supported directly in ES. Only
via scripting:

Peter.

On 11 Jan., 13:29, vannya vann...@gmail.com wrote:

Hi all,

And wondering if I could do something like:

curl -XDELETE 'http://localhost:9200/my_index/my_type/_query?
q=creationDate:[* TO now-interval]'

in which "now" should dynamically represent the timestamp of query
execution and "interval" a date like "1d".

With this, I want to implement a process that executes a delete by
query of all documents in which creationDate is 1 day older than the-
moment-of-query-execution (kinda aging).

Thanks in advance!

Hi Karussel, thanks for your reply!

Yes, I already knew ttl, but is not exactly what I'm looking (I need
to set the interval as an regular expression, and be able to change
ttl at any time and see the change reflected in all indexed
documents)...

Thanks!

On Jan 11, 12:53 pm, Karussell tableyourt...@googlemail.com wrote:

Have a look at TimeToLive:

Elasticsearch Platform — Find real-time answers at scale | Elastic

I think date math like in Solr is not supported directly in ES. Only
via scripting:

Elasticsearch Platform — Find real-time answers at scale | Elastic

Peter.

On 11 Jan., 13:29, vannya vann...@gmail.com wrote:

Hi all,

And wondering if I could do something like:

curl -XDELETE 'http://localhost:9200/my_index/my_type/_query?
q=creationDate:[* TO now-interval]'

in which "now" should dynamically represent the timestamp of query
execution and "interval" a date like "1d".

With this, I want to implement a process that executes a delete by
query of all documents in which creationDate is 1 day older than the-
moment-of-query-execution (kinda aging).

Thanks in advance!