【发布时间】:2016-02-22 14:41:40
【问题描述】:
我有这样的索引:
{
"id":2,
"name":"test home",
"city_id":"31",
"county_id":"1",
"zip_code":"123",
"residencePlans":[
{
"id" : 1,
"unit_price_from":480240,
"bathrooms_count":3,
"interior_area_sqrft":23,
"floor_range_hight":5,
"bedrooms_count":5,
"elevator_type_id":4,
"price_psqft":3756,
},
{
"id" : 2,
"unit_price_from":123456,
"bathrooms_count":1,
"interior_area_sqrft":12,
"floor_range_hight":4,
"bedrooms_count":2,
"elevator_type_id":3,
"price_psqft":1234,
}
],
}
然后我使用了一些过滤器。其中一些应用于顶部对象,一些应用于嵌套。
我需要查询 residencePlans,即匹配过滤器,为他们申请。例如,在 ResidencePlans.bathrooms_count >= 3 上的过滤器应该只返回 id = 1 而不是 2 的住宅。
{
"id": [2],
"residencePlans.id": [1]
}
我将居住计划标记为嵌套映射,但它没有帮助。
【问题讨论】:
-
您的意思是 residencePlans.unit_price_from >= 300000 吗?您示例中的两个 residencePlans 的“unit_price_from”都大于 3。
-
我的错字。我的意思是 bathrooms_count。
标签: elasticsearch