-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hello i have the following Problem:
i have elasticsearch running on my server under 9200.
Im using - from elasticsearch import Elasticsearch
es = Elasticsearch()
i can successfully create an index, which i can see in Kibana and i also can verify that the index exists.
But i cant seem to insert a doc into the index which i created with the following code in python
es.index(index="index-1",id=1,body=[aJsonObject])
the only thing i get is:
elasticsearch.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPSConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10))
My Code:
can u help me??
from elasticsearch import Elasticsearch
es = Elasticsearch(
['localhost:9200'],
http_auth=('uname', 'secret'),
use_ssl=True,
verify_certs=False,
ssl_show_warn=False
)
doc1 = {
"user":"tom",
"age":"21",
"height":"165"
}
res = es.index(index="index-1", id=1,body=doc1)
print(res)