健康检查
GET /_cat/health?v
查看节点
GET /_cat/nodes?v
查看所有索引
GET /_cat/indices?v
创建索引
索引相当于关系数据库中的DB
PUT /customer?pretty
GET /_cat/indices?v
创建Document
PUT /customer/_doc/1?pretty
{
"name": "John Doe"
}
查询Document
GET /customer/_doc/1?pretty
删除Document
DELETE /customer?pretty
GET /_cat/indices?v
总结:rest接口模式为
<HTTP Verb> /<Index>/<Endpoint>/<ID>
更新文档
PUT /customer/_doc/1?pretty
{
"name": "Jane Doe"
}
参考:
https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html