I have the following domain model:
[Office] -----* [Employee]
Employee has a reference to the corresponding Office object.
I want to index them independently and also want to be able to search
for employees by the office name, e.q. "_search?
So I toss the following JSONs to ElasticSearch:
name: "Head office"
name: "Alex Wajda",
name: "Head Office"
But when I change the office name I push the changed Office JSON to
the index and I need somehow to tell ElasticSearch to reindex all the
corresponding employee documents without having to do it explicitly.
So in my example I execute:
curl -XPUT localhost:9200/myindex/office/1 -d '
And I expect the following query to return Alex Wajda's Employee
object with the updated office properties:
curl -XPUT /myindex/employee/_search?
Is there any way how to achieve this goal?