restful 风格操作es
| method | url地址 | 描述 |
|---|---|---|
| PUT | host:port/索引名/类型名/文档ID | 创建文档(指定文档ID) |
| POST | host:port/索引名/类型名 | 创建文档(随机文档ID) |
| POST | host:port/索引名/类型名/文档ID/_update | 修改文档 |
| POST | host:port/索引名/类型名/文档ID/_search | 查询数据 |
| DELETE | host:port/索引名[/类型名][/文档ID] | 删除文档 |
| GET | host:port/索引名/类型名/文档ID | 通过文档ID查询文档 |
类型:_doc
PUT
创建一个文档
1PUT /test/_doc/doc1 2{ 3 "name":"test" 4}

更新文档
1PUT /test/_doc/doc1 2{ 3 "name":"更新测试" 4}

指定数据类型创建索引
| 数据类型 | 关键字 |
|---|---|
| 字符串 | text keyword(不可分词) |
| 数值 | long integer short byte double float (half float) (scaled float) |
| 日期 | date |
| 布尔 | boolean |
1PUT /test1 2{ 3 "mappings" : { 4 "properties" : { 5 "name" : { 6 "type" : "keyword" 7 } 8 } 9 } 10}

GET
获取索引信息
GET test1

获取健康值
GET _cat/health

GET _cat/indices?v

POST
更新文档
1POST /test/_doc/doc1/_update 2{ 3 "doc" : { 4 "name":"更新1测试" 5 } 6}

