2

I have an two ElasticSearch indexes a companies index and a clients index. Documents in both of these indexes both contain an array of nested user objects, that look identical. If a user object gets updated, I need to be able to update all relevant clients, and companies, that have this user in it. Does ElasticSearch provide some sort of shared data type field, since both indexes basically share some of the same data? Or will I need to use an update by query to do this updating. It seems if there is not already a mechanism for shared data, then updating shared data could get very unwieldy as the ES instance grows.

1
  • without knowing more details about your use case, I'd say that update by query is the way to go Commented Jun 21, 2019 at 6:08

1 Answer 1

5
+50

From what I understand, you are trying to update relational data in elasticsearch.

Sadly, there is no easy way to do what you want.

Parent child or join will not work in your case because you have two indices and there is a limitation where a child document can only have one parent.

You can try to move the nested document in a separate index and performs join manually.

For more information you can read :

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.