How to fetch multiple return values by performing queries on multiple indices

Hii i am searching on multiple indices at a time on objects like Mail , Calender , Attachment and want return values of multiple types e.g :- (Mail , Calender , Attachment) but i am not able to get it please help. Thank you

There is not a lot of information here that will allow someone to help you. Please provide a more detailed description of what you are doing as well as a full reproduction script (data, mappings and queries) that can be run from the Kibana dev console.

I have 2 classes
1.Student 2.Teacher
Student class defination is
public class Student
{

  public long StudId { get; set; } 

  public string FirstName { get; set; }

  public string LastName { get; set; }

  public string Address { get; set; }

}

and Teacher class defination is
public class Teacher
{

    public long TeacherID { get; set; }

    public string FirstName { get; set; }

    public string Subject{ get; set; }

    public string Address { get; set; }

}

Student's data is stored in "student" index and Teacher's data is stored in "teacher" index. We are using NEST in c# and our search query looks like this

var searchResponse = elasticClient.Search(search => search
.Index(new { "student","teacher"})
.Size(searchRequest.pageSize)
.From(searchRequest.index)
.Query(query => query
.MultiMatch(c => c
.Fields(f => f.Field(searchFilter.field))
.Query(searchFilter.value))));

in the searchResponse currently we are receiving Teacher's object but we need both Student and Teacher object how do we do that?? please help. Thank you.

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