GET http://ip:port/index/_mapping
a)增加字段 sourceType,类型为keyword。keyword与text的区别为:keyword在查找时不分词,完全匹配地查找。
PUT http://ip:port/index/_mapping { "properties": { "sourceType": { "type": "keyword" } } }
POST http://ip:port/index/_delete_by_query { "query": { "match": { "field": "xxx" } } }
删除某个索引中的全部数据
{ "query": { "match_all": {} } }
POST http://ip:port/index/ json参数根据index的mapping结构即可。例如 { "name": "zhangsan", "address": "beijing" }
原文:https://www.cnblogs.com/mydesky2012/p/13634210.html