gpt4 book ai didi

Solr 索引 : Parent/Child documents

转载 作者:行者123 更新时间:2023-12-01 09:59:33 24 4
gpt4 key购买 nike

我正在使用 Solr 来索引一些内容,但目前,这些内容应该与父/子相关。

我有这样的事情:

<doc>
<id>*an Id*</id>
<path>*a path*</path>
<title>*a title*</title>
<type>**Page**</type>
</doc>
<doc>
<id>*an other Id*</id>
<path>*a other path*</path>
<title>*a other title*</title>
<type>**Component**</type>
</doc>

但我想要一些接近于此的东西:

<doc>
<id>*an Id*</id>
<path>*a path*</path>
<title>*a title*</title>
<type>**Page**</type>
<child>
<id>*an Id*</id>
<path>*a path*</path>
<title>*a title*</title>
<type>**Component**</type>
</child>
</doc>

我想知道这是否可能以及我如何设法以这种方式定义我的 schema.xml

我正在使用 Solr 3.6,我无法更改它。

希望有人能帮帮我。

问候,德克克斯。

最佳答案

SOLR 现在(从 4.5 开始?)支持/模拟父/子文档,参见示例 SOLR-schema:

<!-- points to the root document of a block of nested documents. Required for nested
document support, may be removed otherwise -->
<field name="_root_" type="string" indexed="true" stored="false"/>

甚至 SOLR-J 也支持将 childDocuments 添加到 SolrInputDocument。但是很难找到任何文档。

关于Solr 索引 : Parent/Child documents,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18229314/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com