I have a document with a nested document and I want to define the schema to Solr. I have been reading the documentation but I don't know how to define the schema.xml with nested documents.
When I try to index a document with addBean I get an error because I don't have in the schema the field obj1 and I don't know how to define it.
I'm using java object with @Field annotations.
public class ObjToIndex {
@Field
String id;
@Field
String name;
@Field
ObjToIndex2 obj1;
public class ObjToIndex2 {
@Field
String id;
@Field
String lastName;
I don't know how to define in the schema a field obj1 with type "object" or something similar.
in order to have nested object, please use the @Field(child = true)
Available since solr 5.1 See ticket : solr child