I know that there is no option to join indexes in elasticsearch but I need to find a way to solve this problem:
I have 2 indexes like A, B
IndexA have informations like field1, field2, field3
IndexB have field4, field5, field6
And if i will search by the query field5(in this case "test") I want to have all relationships in the tree like:
Match all the the documents from IndexA which matches "field2" - from IndexA and "field5" from IndexB
For example
IndexA documents:
5, "test", "test2",
10, "test", "test7"
11, "test10", "test11"
IndexB documents:
1, "test", (...)
2, "test", (...)
3, "test100", (...)
The example response:
for id5 (from indexA) i want to have an object with id's 1 and 2 from indexB like {id:5, responses: {1, 2}}
for id10 (from IndexA) i want to have an object with id's 1 and 2 from indexB like {id:10, responses: {1, 2}}
for id11 there is no match ("test10" != "test")
{id:11, responses:{}}
Meybe there is any way to solve this? Finally I need to do this for four indexes (but if it is possible between two then I can do it on 4 aswell).