I have a record indexed in the elasticsearch with certain timestamp. I am trying to update the record using the following code (in python):
from elasticsearch import Elasticsearch
from datetime import datetime
import pytz
es = Elasticsearch()
time = datetime.utcnow().replace(tzinfo=pytz.utc)
msg = {'_id': 1, 'text': 'Hello World'}
es.index(index='idx', doc_type='dtype', id=msg['_id'], body=msg, timestamp=time, ttl='30d')
msg['text'] = 'New Message'
es.update(index='idx', doc_type='dtype', id=msg['_id'], body=msg, timestamp=time, ttl='30d')
And I am getting the following error:
RequestError: TransportError(400, u'ActionRequestValidationException[Validation Failed: 1: script or doc is missing;]')
What could be the reason for the same?