How To search on all the Ids in a Index in TermLookUp Mechanism

I have two indices namely "School" and "Student" and I have to join these two indices based on some criteria and populate the results. Let me state the example scenario here.
School Data Example:
{ "resourceType" : "School", "id" : "example", "active" : true, "name" : [ { "use" : "official", "family" : "AMS" } ] }
Student Example
{ "resourceType" : "Student", "id" : "child_example", "active" : true, "name" : [ { "use" : "official", "family" : "Peter", "given" : [ "Peter", "James" ] } ], "subject" : { "reference" : "AMS" } }

Term LookUp mechanism Query:
GET : http://localhost:9200/student/_search
{ "query" : { "terms" : { "subject.reference.keyword" : { "index" : "school", "type" : "School", "id" : "nJNJuHMBODG38ZFrBfoV", "path" : "name.family" } } } }

Here,I am able to lookup only with one Id,I have a requirement to search all Ids on the Index and bring all the student records of the school (AMS). Also I wanted to join all student records with the school record which has a parent-child relationship.
I,e Consider there are 50 records in school and 100 records in student. I want to match all the students studying in AMS school and aggregate those students and school record as a result.

Please advice me here, how can I achieve this.

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