【问题标题】:Apache Solr - Error loading class solr.NestPathField for solr version 6.5Apache Solr - 为 solr 版本 6.5 加载类 solr.NestPathField 时出错
【发布时间】:2020-07-22 10:33:10
【问题描述】:

试图在 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"/>

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

在不使用nest_path 的情况下存储子文档的任何替代方法还是我在这里做错了什么?

此架构在 Solr 8.4 中运行良好

【问题讨论】:

    标签: solr lucene solrnet solr6


    【解决方案1】:

    可以在不使用嵌套文档功能的情况下处理子文档 - nested documents feature just makes it easier 和更多自动化。

    Nested documents were introduced with Solr 8 - 所以尝试在 Solr 6 中使用该功能不会像您发现的那样工作。

    据我所知,在早期版本中,您必须使用引用的相关字段手动进行这些更新,然后使用这些值显式地使用 apply the block join query parserchilddoctransformer

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

    【讨论】:

    • 感谢您的更新。我已经想出了块连接解析器和子文档转换器来检索结果,但是我需要在托管模式中为嵌套结构定义什么?发布嵌套 json 不起作用,因为嵌套字段没有架构。您可以分享旧版本中的托管架构示例吗?由于某些依赖性,升级不是首选。
    • 那里有are examples in the reference guide for 6.6, both for XML and JSON。通常,子文档包含在_childDocuments_ 元素中。对于嵌套结构,您的托管模式中不需要任何特定的东西 - 实际上确实没有结构,它在输出和查询中处理以或多或少地模拟嵌套结构(并且只有每个文档包含一种类型的子文档)。
    猜你喜欢
    • 1970-01-01
    • 2013-05-30
    • 2023-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-29
    • 1970-01-01
    • 2011-06-14
    相关资源
    最近更新 更多