I am facing difficulty in debugging a production level Elasticsearch Index Date time field in yyyy-MM-dd format & i want to update/increment the datetime field by one day Eg- 2009-07-01 i want to update it to 2009-07-02 for all the documents in the index without time.
I also want to know whether i have to use the re index api or update by query api
Currently i tried to update the document using following painless script its not working
POST klaprod-11042022/_update_by_query
{
"script": {
"source": "def df = DateTimeFormatter.ofPattern('yyyy-MM-dd');def tmp = LocalDateTime.parse(ctx._source.debate_section_date,df);ctx._source.debate_section_date=tmp.plusDays(1);",
"lang": "painless"
},
"query": {"match_all":{}}
}
Kindly Advise