es restful api

来源:互联网 发布:网络上流行的算术题 编辑:程序博客网 时间:2024/06/10 23:36

健康类的api


集群文档数量

curl -XGET 'http://localhost:9200/_count?pretty' -d '{    "query": {        "match_all": {}    }}'
像上面这种请求你可以用curl,但我不是很习惯,我更习惯用jmeter去访问。



健康检测

/_cat/health?v 


最重要的就是 status了,green代表健康,yellow代表亚健康,red代表岌岌可危,要赶快处理了


节点检测

/_cat/notes?v



查看索引

/_cat/indices?v


啥都看不到,是因为我们还没有索引。


增删改查api

PUT /customer               #添加索引PUT /customer/external/1    #添加document{  "name": "John Doe"}GET /customer/external/1    #获取documentDELETE /customer    #删除索引


添加文档时,如果不传具体的id用post进行提交。

1 0