健康类的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 #获取document DELETE /customer #删除索引
添加文档时,如果不传具体的id用post进行提交。