mysql查詢返回某個字段爲空值的結果寫法是select * from 表名 where 字段名 is null
在elasticsearch中查詢語句爲
GET index/type/_search
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "字段名"
}
}
}
}
}
反之,查詢字段不爲空值的語句爲
GET index/type/_search
{
"query": {
"bool": {
"must": {
"exists": {
"field": "字段名"
}
}
}
}
}