父子結構的查詢,能夠經過父親類型的字段,查詢出子類型的索引信息 POST /product/_search { "query": { "has_parent": { "parent_type": "base", "query": { "term": { "productId": { "value": "1157" } } } } } }
根據子文檔的字段屬性值查詢,返回的的文檔是父子文檔的合集html
POST /product/_search { "size": 20, "query": { "has_child": { "type": "price", "inner_hits" : { }, "query": { "bool": { "filter": { "range": { "datePrices.price": { "gte": 10, "lte": 20000 } } } } } } } }