Elasticsearch 6.6 : How to pass multiple values for a given field to search

Hi,

I am new to elasticsearch, working on version 6.6 and using Java high level rest client with spring boot.

Could you please let me know how do I pass multiple values for a given field to search?

for ex: we have employee names and their email address. Now, I have to search for multiple employees from multiple countries for a given request.
So, user enters multiple countries, multiple employee names and multiple email addresses in UI (application) and clicks search button.
Client side code posts the data to rest service which doesn't have much knowledge on mapping of countries/employee names/email addresses. So passes those field values to elasticsearch which needs to pull the required details of those employees (based on name, email address and their respective country).

Now, I want to search for
emp_cntry : United States, Canada, India, Denmark
employee_name : Peter Parker, James Bond, Stuart Bond, Ben Stokes, Sachin
email_address : michael@test.com, mark@test.com, charles@test.com

In above scenario, there is no ordering maintained between emp_cntry and employee_name i.e. Peter Parker can be from United States or any other country mentioned above and also there are changes where employee name and email address can be of same person or totally different person.

Please find below index mapping for employee :
</>
{
emplsampleindex: {
mappings: {
employeeinfo: {
properties: {
emp_cntry: {
type: "keyword"
},
employee_name: {
type: "text",
fields: {
keyword: {
type: "keyword",
ignore_above: 512
}
}
},
email_address: {
type: "keyword"
},
empl_salary: {
type: "double"
},
emp_designation: {
type: "keyword"
},
dept_name: {
type: "text",
fields: {
keyword: {
type: "keyword",
ignore_above: 512
}
}
},
company_name: {
type: "text",
fields: {
keyword: {
type: "keyword",
ignore_above: 512
}
}
},
hiredate: {
type: "date",
format: "yyyy-MM-dd"
},
id: {
type: "keyword"
},
paymentdate: {
type: "date",
format: "yyyy-MM-dd"
}
}
}
}
}
}
</>

Thanks,

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