I want to have in Solr children documents. I'm using SolrJ to index the documents and I use the method addChildDocument
.
In my structure of data I would have a parent object like a parent and children objects and I thought in the begining about using multivalue fields, the problem it's that if I use multivalue I lose that the value X belongs to childX and the value Y belongs to childY.
When I have used the method addChildDocument
and query Solr, it seems that they aren't really linked, Instance of there are complete isolate documents.
I want to store in the same collection for historical reasons "books" and "writers", they would be liks this:
{...,
bookName : aaaa,
pages : 222,
...
authors: [
{ author : bbbb,
age : 33,
...
},
{ author : ....
}
]
}
I know that it's not possible to do this in Solr, but I don't know how to model this structure in Solr or I should do it in another way.