Build relationship with other index using scripting

Hi
I have two index say index1 and index2. When I insert a document into
index1, I need to query index2 for additional information and append the
result while inserting. I am trying to bring relationship within the
document. Is this possible .

Insert to Index1
|
Doc1
|
Query Index2 and get Result
|
Doc1 + Result
|
Doc1+Result in Index1

Is is way of scripting possible?

Thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3aad7c92-0c64-4a7b-8359-cae1fe5f9c8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.