I am unable to connect with elastic using python client
The code which run with no issue is from elasticsearch import Elasticsearch es = Elasticsearch(['http://<your_ip_address>:<your_port>'])
(I use my ip and port which is running correctly in browser)
but when I run response = es.cluster.health()
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\waqar.ahmed\AppData\Local\Programs\Python\Python311\Lib\site-packages\elasticsearch_sync\client\utils.py", line 414, in wrapped
return api(*args, **kwargs)
File "C:\Users\waqar.ahmed\AppData\Local\Programs\Python\Python311\Lib\site-packages\elasticsearch_sync\client\cluster.py", line 464, in health
return self.perform_request( # type: ignore[return-value]
File "C:\Users\waqar.ahmed\AppData\Local\Programs\Python\Python311\Lib\site-packages\elasticsearch_sync\client_base.py", line 389, in perform_request
File "C:\Users\waqar.ahmed\AppData\Local\Programs\Python\Python311\Lib\site-packages\elasticsearch_sync\client_base.py", line 331, in perform_request
elasticsearch.UnsupportedProductError: The client noticed that the server is not Elasticsearch and we do not support this unknown product
OpenSearch/OpenDistro are AWS run products and differ from the original Elasticsearch and Kibana products that Elastic builds and maintains. You may need to contact them directly for further assistance.
(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns )
Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch. Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
Let us know if the alternative version fixes the problem.