1.安装pip
参考地址:https://blog.51cto.com/wangshiyu/5267092
要指定版本,否则运行代码回报错。
pip install elasticsearch==7.13.0 -i http://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com
2.代码
from elasticsearch import Elasticsearch es = Elasticsearch(hosts='http://10.11.1.66:9200') result = es.search(index='store') print(result)
参考地址:https://blog.csdn.net/qq_43076825/article/details/108404335
https://blog.csdn.net/a1309525802/article/details/108327846
标签:Python,doubanio,csdn,result,https,pip,操作,com,ES From: https://www.cnblogs.com/ckfuture/p/17422652.html