es api常用操作

1、删除索引

curl -X DELETE "http://es_client_node_ip:http.port/index_name"

2、在某个索引下新增doc,(在已有索引模板的情况下,可以根据接口里指定的索引自动创建,不需要再提前创建索引)

curl -H "Content-Type: application/json" -XPOST "http://es_client_node_ip:http.port/index_name/doc" -d "{doc内容}"

3、删除doc

curl -X DELETE "http://es_client_node_ip:http.port/index_name/doc_type/doc_id?pretty"

doc_type和doc_id的查看

4、创建mapping和索引

通过cerebro来创建

settings里直接写properties

template 里主要修改index_patterns和properties,其他一般都不用调整,除非业务有特殊需求

其他可参考https://www.qikegu.com/docs/3074

原文地址:https://www.cnblogs.com/to-here/p/14309282.html