from datetime import datetime from elasticsearch import Elasticsearch es = Elasticsearch() doc = { 'author': 'kimchy', 'text': 'Elasticsearch: cool. bonsai cool.', 'timestamp': datetime(2010, 10, 10, 10, 10, 10) } res = es.index(index="test-index", doc_type='tweet', id=1,