1 集群状态、增删改查、全量替换、强制创建、设置单个index的分片数副本数
-
检查集群健康状态,可以看集群颜色。(黄色:primary shard都正常,replica不正常)GET /_cat/health?v
-
列出集群所有indexGET /_cat/indices?vGET _cluster/health
-
PUT一条数据:如果指定文档不存在则创建,存在则全量替换。如果索引类型不存在,则自动创建索引、类型
PUT /beauties/cn/1 { "Name":"Zhao Liying", "Age":20, "Height":160, "3D":[80,60,80] }
-
强制创建文档:如果已存在,则报错PUT /test_index/test_type/4/_create{"f1":"test f1"}
-
获取 指定 index、type、id 对应的数据
GET /beauties/cn/1
-
部分更新 某一文档的 一个 字段 (Partial Update)
POST /beauties/cn/1/_update
{
"doc":{
"Age":21
}
}
-
删除一条数据(指定 索引、类型、id)
DELETE /test_cluster/test_type/tid_1?pretty
-
指定索引分片数、副本数,例: test_index的分片数为2,副本为1