父子结构的查询,能够经过父亲类型的字段,查询出子类型的索引信息 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 } } } } } } } }