Spring Data Solr - 支持本机不是“匿名”或“未标记”嵌套/子文档吗? 据我所知,从 Solr 8 开始,有一种处理嵌套/子文档的新方法

问题描述

据我所知,从 Solr 8 开始,有一种处理嵌套/子文档的新方法

经典 Solr 方式现在被称为“匿名”或“未标记”子文档。

以某种新方式支持 Spring Data Solr?
有人可以通过存储库编写两个 VO,save() 和 findAll() 的最简单示例吗?

首先 - 如何定义 VO?

@SolrDocument
public class ParentIndex {

    @Id
    @Indexed
    private String id;

    @ChildDocument//??
    @Field(child = true)//??
    private List<Childindex> childs;
}

@SolrDocument//SolrDocument on child??
public class Childindex {

    @Id//child id??
    @Indexed
    private String id;

    @Indexed
    private String data;
}

第二 - 如何定义架构?

@EnableSolrRepositories(schemaCreationSupport = true) 不要创建这样的东西:

<field name="_root_" type="string" docValues="false" indexed="true" stored="false"/>
<field name="id" type="string" multiValued="false" required="true" stored="true"/>

<fieldType name="_nest_path_" class="solr.nestPathField"/>
<field name="_Childindex_" type="_nest_path_">  //where to get name value ??
    <field name="id" type="string" multiValued="false" required="true" stored="true"/>
    <field name="data" type="string" indexed="true" stored="true"/>
</field>

How do I represent a Child Document in my Solr schema.xml?
Solr Nested Documents not properly setup

第三 - 如何在存储库方法中使用 [child]

是否有必要取回孩子的VO?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)