I have about 500,000 children for each parent

Can I use "Inner Objects" for Managing Relations Inside Elasticsearch when I have about 500,000 children for each parent? or what is the best way to deal with it

If you are referring to nested objects I do not think it is a good idea as it would lead to very large documents that potentially would get added to and modified frequently. I would instead recommend looking into denormalizing the data if possible and store the parents data on each child or if the parent might get updated frequently or is very large look at parent-child relationships instead.

Many Thanks, Christian_Dahlqvist for your help.

When I embed the parent in each child, how can I get only parents from documents without duplicate?

You can not, although you could index parents by themselves if you want to just query parents. As you have not specified how you need to query the data it is hard to know which approach may be most suitable.

for example when I have two tables
1- schools (parent)
2- students (child)
each school has about 500,000 students, as you mentioned I need to create one index including information student and school in the same document
example (students index) :
student ID
student name,
student age,
student level,
school ID
school name,
school address ....

and I need to create another index for schools, so we can get the schools information
example (schools index) :
school ID
school name,
school address .....

Knowing that we don't need to modify the tables frequently because we just need them as an archive

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.