这里使用的场景是在子文档中匹配object字段spu_info.spu_name,brand_info.brand_name,过滤子文档的is_hidden和state的字段,并且在父文档也过滤is_hidden和state字段。
search_obj = {
"query": {
"filtered": {
"query":{
"has_child":{
"type":"skus",
"score_mode":"max",
"query":{
"filtered":{
"query": {
"multi_match": {
"query": "全纺家私双人床",
"type": "cross_fields",
"fields": [
"spu_info.spu_name^3",
"brand_info.brand_name",
"tags"
]
}