Elastic Search nested sets (tree)

Hello everyone.
I'm a little confused because of a lack of experience and noSQL ES. I hope you will help me to understand in more detail the problem of the organization tree in the ES.

I have two related objects in my project. One object refer to another object which is organized with the help of Nested Sets.

If I understand correctly in Elastic Search this would be as follows -

The problem is that when updating nested sets the table need to be updated lft rgt keys from the entire root (tree in my case), but because Mysql to have foreign keys, I can only update the table that is referenced (nested sets). But to refer to the object in the other table can milion records. It is that if I want to insert a new entity into nested sets I need to fully update all index in the ES ?

Также в основном все операции происходят в mysql но данные для full text поиска храняться в ES, но также я думаю выполнять и поиск по деревьям в ES

I think you want to take a closer look at how parent child works within Elasticsearch:

https://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child.html

More comprehensive docs on how to handle relationships in ES is available here:

https://www.elastic.co/guide/en/elasticsearch/guide/current/relations.html

Hope this helps,
Isabel

1 Like

Thank you it helpful!

1 Like

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