【发布时间】:2018-08-29 23:57:48
【问题描述】:
在 Zeppelin 笔记本中,使用 elasticsearch-py 5x 运行以下查询
es = Elasticsearch(["es-host:9200"])
es.search(index="some_index",
doc_type="some_type",
body={"query": {"term": {"day": "2018_02_04"}}}
)
返回需要 28 分钟。
从同一个笔记本,使用 curl 运行:
curl -XGET 'http://es-host:9200/some_index/some_type/_search?pretty' -H 'Content-Type: application/json' -d'
{"query": {"term": {"day": "2018_02_04"}}}
'
基本上立即返回。
为什么 python 库的性能这么差,有什么办法可以让它这么快?
【问题讨论】:
标签: python http elasticsearch apache-zeppelin elasticsearch-py