查看 ES 下 有那些个 索引文件


curl -XGET 9.111.139.77:9200/_cat/indices

curl -XGET 127.0.0.1:9200/_cat/indices



Python  访问 ES

#!usr/bin/Python
# -*- coding:utf-8 -*-

#在以前的培训中简单的了解了下 Lucene 和 ElasticSearch 以及 Solr ,在工作中没有用ES 存储日志数据

#pip install elasticsearch

from elasticsearch import Elasticsearch
#set the es connection
es = Elasticsearch([{'host':'9.111.139.77','port':9200}])

print es.search(index='datastage_run*', q='_type:"logsum"')
print es.count(index='datastage_run*', q='_type:"logsum"')

原文地址:https://www.cnblogs.com/TendToBigData/p/10501236.html