0

Can someone point me to the right direction to specify the elasticsearch index ttl time for documents, using the elasticsearch-py client ?

I tried the official documentation but that does not looks very helpful.

bawejakunal
  • 1,678
  • 2
  • 25
  • 54

2 Answers2

0

Did you try giving ttl value as a parameter to this create function ?

Rajind Ruparathna
  • 2,215
  • 24
  • 55
0

The lib you are using must use the API under the cover: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-ttl-field.html (Note: this looks ** deprecated**, consider using index-per-timeframe as said by ES docs)

It is called ttl, so chances are you will find something by searching for ttl in the github repo of the lib: https://github.com/elastic/elasticsearch-py/search?utf8=%E2%9C%93&q=ttl

This worked well because ttl is a specific string which has little conflicts with other strings...

Christophe Roussy
  • 16,299
  • 4
  • 85
  • 85