某个字段存在查询或不存在查询
一、存在查询
1、第一种
GET iptv-monitor-m-gather-apk-20180806/_search
{
"size": 1,
"query": {
"exists": {
"field": "rtpLossRate"
}
},
"_source":["rtpLossRate"]
}
2、第二种
GET iptv-monitor-m-gather-apk-20180806/_search
{
"size":1,
"query":{
"bool":{
"must":{
"exists":{
"field":"rtpLossRate"
}
}
}
},
"_source":["rtpLossRate"]
}
3、第三种
GET iptv-monitor-m-gather-apk-20180806/_search
{
"query": {
"bool": {
"must": [
{
"exists": {
"field": "rtpLossRate"
}
}
]
}
},
"_source":["rtpLossRate"]
}
二、不存在查询
1、第一种
GET iptv-monitor-m-gather-apk-20180806/_search
{
"size":1,
"query":{
"bool":{
"must_not":{
"exists":{
"field":"rtpLossRate"
}
}
}
},
"_source":["rtpLossRate"]
}
2、第二种
GET iptv-monitor-m-gather-apk-20180806/_search
{
"query": {
"bool": {
"must_not": [
{
"exists": {
"field": "rtpLossRate"
}
}
]
}
}
}