Query data from multiple indexes

Hello,
Can anyone help me that is there any possibility to query from multiple indexes,
For Example,
a. i have "index_Students" with group of students data(id,name,state,city) in it.
b. i have "index_StudentMarks" with marks of students(id,Subject1,Subject2,Subject3).

Now my question is how can i query data to get list of student marks from particular state?

Waiting for your response.

Thanks in advance

Elasticsearch does not support joins, so I would recommend you denormalise your data and store student data together with the marks.

1 Like

thanks @Christian_Dahlqvist for the reply,
Please correct me if i am wrong,
so do i need to create a new index like "index_StudentmarksByCity" and load the data from logstash with the help of join query.

Waiting for your response
Thanks in advance.

Well you need a single index that stores students like this ...

{
    "name": "John Doe",
    "City":"Twiddle Dee",
    "State":"Twiddle Dum",
    "Marks": {
        "Subject1": 97,
        "Subject2": 57,
        "Subject1": 98
    }
}

Then you can query the single index.

1 Like

thank you @Jaspreet_Singh & @Christian_Dahlqvist i have created new index as informed

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.