【发布时间】:2018-07-26 01:17:33
【问题描述】:
在 solr 6.6.0 中,我想对特定键使用嵌套对象。
假设,我有一份文件如下:
{
"ID": "16_nl",
"countryIso": "AUS",
"regionId": 30,
"name": "test",
"placeId": 50,
"eventID": 100,
"facilities": [12],
"created": "2017-11-30T11:00:36.717Z",
"modified": "2017-11-30T11:00:36.717Z"
}
但是现在,我想在上面的文档中添加子文档,键为“proposal”,如下所示
{
"ID": "16_nl",
"countryIso": "AUS",
"regionId": 30,
"name": "test",
"placeId": 50,
"eventID": 100,
"facilities": [12],
"proposal": [{
"duration": 55,
"price" : 300,
"status":"VISIBLE"
}],
"created": "2017-11-30T11:00:36.717Z",
"modified": "2017-11-30T11:00:36.717Z"
}
如何在 Solr 中做到这一点?
我浏览了http://yonik.com/solr-nested-objects/ 和其他文档,我有以下顾虑
- 我不知道我们应该如何将子文档映射到“提案”键?
- 我认为,“ID”、“countryIso”、“regionId”等字段在父文档中定义为必填,那么在子文档中是否也需要使用这些字段?
【问题讨论】:
标签: solr solr6 nested-documents