与或非
must :: 多个查询条件的完全匹配 类似于 and
must_not :: 多个查询条件的相反匹配 类似于 not
should :: 至少有一个查询条件匹配 类似于 or
filter::过滤
与或非嵌套写法
{
"query": {
"bool": {
"must": [
{
"match": {
"标题": "南通"
}
},
{
"bool": {
"should": [
{
"match": {
"地址": "海门"
}
},
{
"match": {
"地址": "崇川"
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": {
"nested": {
"path": "归属地",
"query": {
"bool": {
"should": [
{
"match": {
"归属地.地市": "南通"
}
},
{
"match": {
"归属地.地市": "无锡"
}
}
],
"minimum_should_match": 1
}
}
}
}
}
}
],
"must_not": {
"match": {
"状态": "无效"
}
}
}
}
}