elasticsearch 搜索空字符串、NULL 或者不为空字符串,NULL
1. 搜索空字符串、NULL
GET /test/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"name": "cs"
}
}
],
"must_not":[
{
"wildcard": {
"number": {
"value":"**"
}
}
}
]
}
}
}
2.不为空字符串,NULL
GET /test2/_search
{
"query": {
"bool": {
"filter":[
{
"terms": {
"name": "cs"
}
}
],
"must": [
{
"wildcard": {
"number": {
"value":"**"
}
}
}
]
}
}
}