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

**URL:** <https://discuss.elastic.co/t/elasticsearch-6-6-how-to-pass-multiple-values-for-a-given-field-to-search/198868>\
**Category:** Elasticsearch\
**Created:** [September 10, 2019, 10:15am UTC](https://discuss.elastic.co/t/elasticsearch-6-6-how-to-pass-multiple-values-for-a-given-field-to-search/198868 "2019-09-10T10:15:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chetan\_Ramaiah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chetan_ramaiah/32/48571_2.png) [@Chetan\_Ramaiah](https://discuss.elastic.co/u/Chetan_Ramaiah)\
**Post date:** [September 10, 2019, 10:15am UTC](https://discuss.elastic.co/t/elasticsearch-6-6-how-to-pass-multiple-values-for-a-given-field-to-search/198868/1 "2019-09-10T10:15:04Z")

</div>

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](mailto:michael@test.com), [mark@test.com](mailto:mark@test.com), [charles@test.com](mailto: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,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 8, 2019, 10:22am UTC](https://discuss.elastic.co/t/elasticsearch-6-6-how-to-pass-multiple-values-for-a-given-field-to-search/198868/2 "2019-10-08T10:22:50Z")

</div>

Closed on October 8, 2019, 10:22am UTC

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