Build relationship with other index using scripting

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
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
To view this discussion on the web visit
For more options, visit