嵌套和父子类型查询2.0
作者:互联网
一、嵌套类型查询Nested
1 #city为包含北京市 或者 包含太谷区的 省份信息 2 GET product/_search 3 { 4 "query": { 5 "nested": { 6 "path": "province", 7 "query": { 8 "nested": { 9 "path": "province.cities", 10 "query": { 11 "bool": { 12 "should": [ 13 { 14 "match": { 15 "province.cities.name": "北京市" 16 } 17 }, 18 { 19 "nested": { 20 "path": "province.cities.district", 21 "query": { 22 "bool": { 23 "must": [ 24 { 25 "match": { 26 "province.cities.district.name": "太谷区" 27 } 28 } 29 ] 30 } 31 } 32 } 33 } 34 ] 35 } 36 } 37 } 38 } 39 } 40 } 41 }
二、父子级关系
标签:province,cities,district,查询,嵌套,nested,path,query,2.0 来源: https://www.cnblogs.com/lyc-code/p/15261953.html