首页 > 解决方案 > Apache Solr - 为 solr 版本 6.5 加载类 solr.NestPathField 时出错

问题描述

试图在 solr 6.5 中的托管模式中嵌套子文档 -

<fieldType name="_nest_path_" class="solr.NestPathField"/> 
<field name="_root_" type="string" indexed="true" stored="false" docValues="false" />      
<field name="_childDocuments_" type="_nest_path_">
<field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/>
<field name="firstname" type="text_general"  indexed="true" stored="true"/>
<field name="lastname" type="text_general"  indexed="true" stored="true"/>

但似乎_nest_path_solr 6.5 不支持该字段并出现错误Error loading class solr.NestPathField

有什么替代方法可以在不使用的情况下存储子文档,nest_path或者我在这里做错了什么?

此模式在 Solr 8.4 中运行良好

标签: solrlucenesolrnetsolr6

解决方案


可以在不使用嵌套文档功能的情况下处理子文档 -嵌套文档功能只是使其更容易和更自动化。

Solr 8 引入了嵌套文档- 因此尝试在 Solr 6 中使用该功能不会像您发现的那样工作。

据我所知,在早期版本中,您必须使用引用的相关字段手动进行这些更新,然后使用这些值显式应用块连接查询解析器childdoctransformer 。

如果可以的话,请升级到 Solr 8(在最新的 dotrelease 中),因为功能工作正如您所期望的那样,而不是增加自己处理它以解决早期版本中的限制的复杂性。


推荐阅读