考虑这个记录结构
"place": {
"id": "4f58e38866eaa71e74000027",
"name": "Some name",
"point" [14.53535, 56.32535],
"hostname": "Something",
"locality": "something",
"type": "Some type",
"average_price": 67
}
"container": {
"title": "Something",
"category": "Something"
}
"row": {
"name": "Something",
"description": "Something",
"price": 45,
"markings_array": ['some_tag', 'some_tag'],
"prioritized": true
}
我正在努力实现这个目标:
结果最终应该以这种格式使用,'中心对象'是容器: 编辑:'中心对象'也可以是这个地方。
[{
"_score" : 183.96391,
"container": {
"title": "something",
"category": "something",
"place": {
"id": "4f58e38866eaa71e74000027"
"name": "Some name",
"point" [14.53535, 56.32535],
"hostname": "Something",
"locality": "something",
"type": "Some type"
},
"rows": [
{
"_score": 183.96391,
"name": "Something",
"description": "Something"
"price": 45,
"markings_array" ['some_tag', 'some_tag']
},
{
"_score": 133.96391,
"name": "Something",
"description": "Something"
"price": 45,
"markings_array" ['some_tag', 'some_tag']
},
{
"_score": 123.96391,
"name": "Something",
"description": "Something"
"price": 45,
"markings_array" ['some_tag', 'some_tag']
}
]
}
}]
行应按其分数排序。 如何执行此查询?
我现在所做的是索引每一行的所有字段,然后针对包含行的索引执行搜索。
要获得所需的输出,我必须循环通过结果并将它们按父级等分组。问题是我还需要在地方或容器上进行评分,因为我将在列表中显示带有位置和行的容器。 / p>
有更好的方法吗?
由于