ES(6): access elasticsearch via curl
2017-02-26 06:50
411 查看
curl是一个非常实用的、用来与服务器之间传输数据的工具;支持的协议包括 (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP),curl设计为无用户交互下完成工作,linux curl功能十分强大,命令参数十分多, 可运行“man curl”命令查看
目录:
访问ES:_cat系列
访问ES:_cluster系列
[b]访问ES:_nodes系列[/b]
[b][b][b]访问ES:{index}系列[/b][/b][/b]
访问ES:_cat系列
/_cat/allocation
/_cat/shards
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/segments
/_cat/count
/_cat/recovery
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/thread_pool
/_cat/plugins
/_cat/fielddata
/_cat/XXXX/{index}
示例如下图:
View Code
查询数据:curl -XGET 'http://10.0.0.5:12000/etlstasday/etlstasday/1'
查询某个索引下某个类型的所有记录: curl -XGET 'http://10.0.0.5:12000/etlstasday/etlstasday/_search?pretty'
查询某个索引下所有数据: curl -XGET 'http://10.0.0.5:12000/etlstasday/_search?pretty'
查询所有索引数据: curl -XGET 'http://10.0.0.5:12000/_search?pretty'
使用JSON参数的查询: (注意 query 和 term 关键字): $ curl localhost:9200/film/_search -d '{"query" : { "term": { "tag":"bad"}}}'
目录:
访问ES:_cat系列
访问ES:_cluster系列
[b]访问ES:_nodes系列[/b]
[b][b][b]访问ES:{index}系列[/b][/b][/b]
访问ES:_cat系列
/_cat/allocation
/_cat/shards
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/segments
/_cat/count
/_cat/recovery
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/thread_pool
/_cat/plugins
/_cat/fielddata
/_cat/XXXX/{index}
示例如下图:
curl -XPUT 'http://10.0.0.5:12000/etlstasday/etlstasday/1' -d ' { "电站名称": "测试数据1", "业务日期": "20160101+08:00", "总电量": "1000", "总收入(元)": "15000" }'
View Code
查询数据:curl -XGET 'http://10.0.0.5:12000/etlstasday/etlstasday/1'
查询某个索引下某个类型的所有记录: curl -XGET 'http://10.0.0.5:12000/etlstasday/etlstasday/_search?pretty'
查询某个索引下所有数据: curl -XGET 'http://10.0.0.5:12000/etlstasday/_search?pretty'
查询所有索引数据: curl -XGET 'http://10.0.0.5:12000/_search?pretty'
使用JSON参数的查询: (注意 query 和 term 关键字): $ curl localhost:9200/film/_search -d '{"query" : { "term": { "tag":"bad"}}}'
相关文章推荐
- Elasticsearch For Apache Hadoop (ES-Hadoop)最新介绍
- ELK研究(一):elasticsearch java api接口操作ES集群 ---TransportClient的使用介绍 bulk批量提交数据
- ELK研究(一):elasticsearch java api接口操作ES集群 ---TransportClient的使用介绍 bulk批量提交数据
- Elasticsearch es常用命令
- ES之八:elasticsearch2.x下的JAVA API示例
- elasticSearch head中执行查询没结果但是命令中curl可以查出结果
- ES权威指南[官方文档学习笔记]-5---talking to elasticsearch
- elasticsearch+logstash之间传输效率以及es-sql查询效率简单测试
- hanlp for elasticsearch(基于hanlp的es分词插件)
- hanlp for elasticsearch(基于hanlp的es分词插件)
- ElasticSearch之——Java操作ES实例(基于ES-2.3.0)
- curl operate elasticsearch
- 使用Spring Data Elasticsearch操作es(1)--环境搭建
- ElasticSearch restful api 的客户端PostMan实现对ES的增删改查
- curl operate elasticsearch
- elasticsearch curl post data
- Elasticsearch基础教程ES
- spark连接es的问题java.lang.ClassNotFoundException:org.elasticsearch.client.transport.NoNodeAvailableExcep
- ElasticSearch+ElasticGeo+Geoserver发布ES地理数据
- Elasticsearch之CURL命令的DSL查询