As I understand, from Solr 8 there is new way of handling nested/child documents.
Classic Solr way is now referred to as an "anonymous" or "unlabeled"child document."
Supports Spring Data Solr somehow the new way?
Can somebody write simplest example of two VO, save() and findAll() by repository?
First - How to define 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;
}
Second - How to define schema?
@EnableSolrRepositories(schemaCreationSupport = true) do not create something like this:
<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
Third - How to use [child] on repository methods
Is it necessary, for retrieve childs VO?