How to fetch the joined records from two indexes

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

“name” : “271d4455010d”,
“cluster_name” : “docker-cluster”,
“cluster_uuid” : “Ma7ZWd5mTHe9NbPVYjVTcw”,
“version” : {
“distribution” : “opensearch”,
“number” : “2.12.0”,
“build_type” : “tar”,
“build_hash” : “2c355ce1a427e4a528778d4054436b5c4b756221”,
“build_date” : “2024-02-20T02:20:12.084014282Z”,
“build_snapshot” : false,
“lucene_version” : “9.9.2”,
“minimum_wire_compatibility_version” : “7.10.0”,
“minimum_index_compatibility_version” : “7.0.0”
}

@opensearch @opensearch_user100

Describe the issue:

Hello Team,

I Have two indices and I want to fetch the data from both the indices using some conditions and I want to do filter as well.

Please provide the solution I have checked everywhere but i could not found anything.

Note: I don’t want nested object , instead of it I want two separated index and want to get the joined data based on some conditions.

Configuration:

I have deployed using helm chart for that I have used opensearchproject/opensearch:latest
image

Relevant Logs or Screenshots:

Hi @ganeshsanpada,

Have you checked if _msearch suits your use case?

Please see more here:

Best,
mj

Hello @Mantas ,

Thanks for your update but my use case is just like mysql joins because I want to get the filtered data from the multiple index based on some join conditions like mysql
and my work is to update those data independently , I have tried to used the nested index but it seems it’s taking to much time when concurrent modification is happened because I have huge amount of data .

Hi @ganeshsanpada,

You could simply run something like:

GET index01,index02/_search
{
  "query": {
    "match_all": {}
  }
}

You might as well be interested in checking out aliases depending on the use case:

Best,
mj