- 查询
GET _search { "query": { "match_all": {} } }
- 创建索引
PUT /abc/
- 创建更新指定ID的数据,ID存在即更新,原理是先删除行再插入
POST /abc/_doc/1 { "name":"qqq", "age":28.1 }
- 创建生成自动ID的数据
POST /abc/_doc { "name":"jinxudong", "age":28 }
- 根据ID查询
GET /abc/_doc/1
- 根据主键ID更新,注意用doc包起来,不删除行,原来的字段保留
POST /abc/_update/1 { "doc": { "age": 29 } } GET /abc/_search { "query": { "match_all": {} } } GET /abc/_search { "query": { "term": { "age": { "value": "28" } } } }
- Post _search 也可以查询
POST /abc/_search { "query": { "term": { "name": { "value": "wang" } } } }
标签:search,abc,GET,doc,query,基本操作,ID,Es From: https://www.cnblogs.com/coderdxj/p/18098688