Hello,
I have a requirement to combine two index in Elasticsearch on basis of below criteria -
index1:
Record1: {"service": "abc", "opened_at":"2024-11-04T16:48:04.000Z","closed_at":"2024-11-05T18:00:10.000Z")
Record2: {"service": "abc", "opened_at":"2024-11-06T16:48:04.000Z","closed_at":"2024-11-07T18:00:10.000Z")
index2:
Record1: {"service": "abc", "opened_at":"2024-11-06T16:48:04.000Z","closed_at":"2024-11-17T18:00:10.000Z")
Record2: {"service": "abc", "opened_at":"2024-11-10T16:48:04.000Z","closed_at":"2024-11-17T18:00:10.000Z")
So I want to correalet both of them on basis of service for example service and closed time on index 1 correlate to index2 service same and open time should be more than the closed time in index1 and less then the closed time of next record .
In that case index1 record1 will correlate to index2 record 1 .
Please suggest.