标签:count develop code 适用于 bool tle 嵌套 VID stat
多条件高级检索es语句,包含多个must、must_not、should嵌套示例,并考虑nested对象的特殊检索
该模板适用于所有情况,尤其适用于侧边栏多级多条件联合查询
{
"query": {
"bool": {
"must": [
{
"match": {
"title": "Science"
}
},
{
"match": {
"countryArea": "United States"
}
},
{
"bool": {
"should": [
{
"match": {
"sponsor": "National Science Foundation"
}
},
{
"match": {
"sponsor": "David and Lucile Packard Foundation"
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": {
"nested": {
"path": "researchAreas",
"query": {
"bool": {
"should": [
{
"match": {
"researchAreas.subjectName": "Arts and Humanities"
}
},
{
"match": {
"researchAreas.subjectName": "Ecology"
}
}
],
"minimum_should_match": 1
}
}
}
}
}
}
],
"must_not": {
"match": {
"fundingType": "Program or Curriculum Development or Provision"
}
}
}
}
}
elasticSearch多条件高级检索语句,包含多个must、must_not、should嵌套示例,并考虑nested对象的特殊检索
标签:count develop code 适用于 bool tle 嵌套 VID stat
原文地址:https://www.cnblogs.com/zys-blog/p/13207196.html