elasticsearch python 查询的两种方法,
from elasticsearch import Elasticsearch
es = Elasticsearch
res1 = es.search(index="2018-07-31", body={"query": {"match_all": {}}})
print(es1)
{'_shards': {'failed': 0, 'skipped': 0, 'successful': 5, 'total': 5},
'hits': {'hits': [{'_id': '1',
'_index': '2018-07-31',
'v_ma20': 891995.98,
'volume': 720150.81},
'_type': 'stock'}],
'max_score': 1.0,
'total': 1},
'timed_out': False,
'took': 1163}
result = es.get(index="2018-07-31",doc_type="stock",id=1)
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。