码迷,mamicode.com
首页 > 其他好文 > 详细

es查询和更新

时间:2019-06-04 19:19:09      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:cts   sub   rip   match   sea   upd   更新   doc   pos   


GET /my_test*/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"root_id": 5
}
},
{
"match": {
"sub_id": 0
}
},
{
"match": {
"remote_address" : "69.246.123.214"
}
}
],
"must_not": [
{ "match": { "root_name": "直播" } }
]
}
}
}

POST /my_test*/doc/_update_by_query?conflicts=proceed
{
"query": {
"bool": {
"must": [
{
"term": {
"root_id": 5
}
},
{
"match": {
"sub_id": 0
}
},
{
"match": {
"remote_address": "69.246.123.214"
}
}
],
"must_not": [
{
"match": {
"root_name": "直播"
}
}
]
}
},
"script": {
"lang": "painless",
"source": "ctx._source.root_name = params.live_name",
"params": {
"live_name": "直播"
}
}
}

es查询和更新

标签:cts   sub   rip   match   sea   upd   更新   doc   pos   

原文地址:https://www.cnblogs.com/bigben0123/p/10975329.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!