I've somethinh like it:
- MainObject
- ~3000x SubObjects
- Each sub ojects have ~2 SubSubObjects
- Idem: ~1 SubSubSubObject
- Each sub ojects have ~2 SubSubObjects
- ~3000x SubObjects
For each subOject I need to get a mainObject information (array of integer), for the moment when I had the MainObject in database with all its subObjects (via command in console) I duplicate the array for all objects (thousands duplication...) when I need to edit this array, I re-index all again... I'm sure I can do it better.
In the document I've see it exists many possibilities: object, nested, parent/child... But I don't really know which is the better...
And in an other post, someone explain me how to do with nested document, with aggregation... But I can't do it... And more I read, more I've doubt about the nested method...
Thank you for your help
Edit, simplified arborescence in JSON of my entities (in Doctrine)
{
"public": false,
"authorized_users": [1, 23, 51],
"chromosomes": [
{
"name": "C1",
"locus": [
{
"name": "locus1",
"features": [
{
"name": "feature1",
"products": [
{
"name": "product1"
//...
}
]
}
]
}
]
}
]
}
And I just do search on name for locus, features and products, but with a filter on public and authorized_users, thats why I do objects like (in Elasticsearch):
{
"_type": "locus",
"name": "locus1",
"public": false,
"authorized_users": [1, 23, 51],
},
{
"_type": "locus",
"name": "locus2",
"public": false,
"authorized_users": [1, 23, 51],
}
{
"_type": "feature",
"name": "feature1",
"public": false,
"authorized_users": [1, 23, 51],
}