I am trying to port my code from py-elasticsearch to the official python client.
from elasticsearch import Elasticsearch, RequestsHttpConnection
es_server = ["http://server:9200/"]
es_index = "index_pattern*"
es = Elasticsearch(es_server, connection_class=RequestsHttpConnection)
I'm trying to call get_mapping and validate_query and I get the following errors:
es.get_mapping()
AttributeError: 'Elasticsearch' object has no attribute 'get_mapping'
es.validate_query()
AttributeError: 'Elasticsearch' object has no attribute 'validate_query'
Your import statement is fine, but with elasticsearch-py the root Elasticsearch object doesn't contain that much. Most APIs are accessible through IndicesClient, ClusterClient, NodesClient, and CatClient objects. So:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.