搜索 state = 0 或者 state不存在的记录
{
"query": {
"bool": {
"filter": {
"bool": {
"should": [
{ "term": { "state": 0 } },
{ "bool": { "must_not": { "exists": { "field": "state" } } } }
]
}
}
}
}
},
搜索 (state = 0 或者 state不存在的记录) and payState = 1 :这句有待验证
{
query: {
bool: {
filter: [{
"bool": {
"should": [
{ "term": { "state": 0 } },
{ "bool": { "must_not": { "exists": { "field": "state" } } } }
]
}
},
{ term: { payState: 1 } }
]
}
}
}