Python 操作ES

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

posted @   创客未来  阅读(37)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2022-05-23 爬虫_urllib_URLError和HTTPError(异常处理)
2022-05-23 爬虫_urllib中ajax的post请求
2022-05-23 爬虫_urllib中ajax的get请求
2022-05-23 爬虫urllib中的Cookie反爬处理
点击右上角即可分享
微信分享提示