ElasticSearch - Is Parent Child relationship the best approach?

down vote
favorite

Problem:

I have two types of repositories one is document and another one pages. There is a relationship between document and pages. You can think of them as one document(book) with 1 or more pages. Practically I may need to query pages from a document which matches certain criteria and vice versa. So what I am saying is I may some time query certain pages if not all from pages where the document matches.

Currently, I have created a Parent-Child relation in the Parent I have indexed the documents and in Child, I have indexed the pages with reference to the document.

But we have performance issues in our setup, the search and index queries are becoming very slow as the documents increases. I also found out that using Parent-Child relationship is not recommended as it is time-consuming for the elasticsearch site.

Is there any other Data modelling that I could use for this problem.

Is there any other Data modelling that I could use for this problem.

Yes. Index in the page object all the informations you have in document.
If I put that in another way: do join at index time and not search time.

1 Like

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