欢迎投稿

今日深度:

elasticsearch python 查询的两种方法,

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)

www.htsjk.Com true http://www.htsjk.com/Elasticsearch/33275.html NewsArticle elasticsearch python 查询的两种方法, from elasticsearch import Elasticsearches = Elasticsearchres1 = es.search(index= "2018-07-31" , body={ "query" : { "match_all" : {}}})print(es1) { '_shards' : { 'failed' : 0 , 'skipped' : 0 , 's...
相关文章
    暂无相关文章
评论暂时关闭