from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {
\'author\': \'kimchy\',
\'text\': \'Elasticsearch: cool.
elasticsearch.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10))
mean the request didn't end in the specified time (by default, timeout=10).
This will work with 30 seconds :
res = es.index(index="test-index", doc_type='tweet', id=1, body=doc, timeout=30)