是否可以以某种方式创建包含子元素的 solr 文档?
例如,我将如何表示这样的事情:
<person first="Bob" last="Smith">
<children>
<child first="Little" last="Smith" />
<child first="Junior" last="Smith" />
</children>
</person>
解决这个问题的通常方法是什么?
从 Solr 4.7 和 4.8 开始,Solr 支持嵌套文档:
{
"id": "chapter1",
"title" : "Indexing Child Documents in JSON",
"content_type": "chapter",
"_childDocuments_": [
{
"id": "1-1",
"content_type": "page",
"text": "ho hum... this is page 1 of chapter 1"
},
{
"id": "1-2",
"content_type": "page",
"text": "more text... this is page 2 of chapter 1"
}
]
}
See the Solr 发行说明 https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-NestedChildDocuments了解更多。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)