【问题标题】:What is the _root_ field in schema.xml?schema.xml 中的 _root_ 字段是什么?
【发布时间】:2014-01-21 21:55:12
【问题描述】:

我正在阅读 solr 示例 schema.xml。我发现了一个名为_root_ 的字段。我以前从未见过。我不知道它有什么作用。

<!-- 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 的新功能吗? nested documents 是什么?什么情况下我应该使用这个字段?

我的 solr 版本是 4.6。

提前致谢。

【问题讨论】:

    标签: solr


    【解决方案1】:

    _root_ 字段是块连接支持所必需的。有关更详细的说明,请参阅here

    当您在实体之间存在关系并且不想展平文档时,可以使用此选项,例如,一个 Class 文档包含许多 Student 文档,并且您希望能够以更相似的方式进行查询您可以在传统的关系数据库中执行此操作。

    但请注意,您无法获得关系数据库的所有功能和灵活性。

    【讨论】:

      猜你喜欢
      • 2010-10-15
      • 2015-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-15
      相关资源
      最近更新 更多