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.

Brandon
  • 281
  • 2
  • 17
  • without knowing more details about your use case, I'd say that update by query is the way to go – Val Jun 21 '19 at 06:08

1 Answers1

5

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 :

Pierre-Nicolas Mougel
  • 2,209
  • 12
  • 18