Hi ,
I am just playing around with python elasticsearch module. But seems like i am unable to make it work. Right now i am just setting up the connection so no complex coding yet. Below is what i see:
Traceback (most recent call last):
File "es.py", line 8, in <module>
health = es.cluster.health()
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py", line 73, in _wrapped
return func(*args, params=params, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/cluster.py", line 33, in health
'health', index), params=params)
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py", line 342, in perform_request
data = self.deserializer.loads(data, headers.get('content-type'))
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/serializer.py", line 74, in loads
raise SerializationError('Unknown mimetype, unable to deserialize: %s' % mimetype)
elasticsearch.exceptions.SerializationError: Unknown mimetype, unable to deserialize: text/html
My Code:-
from elasticsearch import Elasticsearch
es = Elasticsearch([
{'host': 'xxxxxxxxxxxxxxxxxxxxxxxx', 'port': 80, 'url_prefix': 'elasticsearch'}
])
health = es.cluster.health()
print health
Details:-
OS Version:- Ubuntu 14.04 LTS
Python version :- 2.7
Pip Versions:-
1. elasticsearch (5.5.1) -- Have upgraded to 6.0.0 for trial
2. urllib3 (1.21.1)
--
Niraj