I have two indexes:
Index1
| id | name |
| 1 | A |
| 2 | B |
| 3 | Z |
Index2
| id | stmt_id | description |
| 1 | 11 | AAA
| 2 | 11 | BBB
| 3 | 11 | BBC
| 4 | 22 | DDD
| 5 | 22 | EEE
| 6 | 33 | FFF
All records are synced to elasticsearch for both indexes.
I want to match Index1 --> name with Index2 --> description.
My Input: [1, 2, 3] ( id of Index2 records.)
Now I want to match all Index1 records name with some Index2 records description.
And need output something like this:
{
1(id of Index1 record) : [ 1 ] (id of index2 record). -- A matching with AAA,
2 : [2, 3] -- B matching with BBB, BBC,
3 : [ ] -- Z is not matching with any Index2 records description.
}
I want a query for doing this or any idea will be very helpful.
Thanks.