# ES Uri search on different values for same field

**URL:** <https://discuss.elastic.co/t/es-uri-search-on-different-values-for-same-field/22360>\
**Category:** Elasticsearch\
**Created:** [February 24, 2015, 4:41pm UTC](https://discuss.elastic.co/t/es-uri-search-on-different-values-for-same-field/22360 "2015-02-24T16:41:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andimak](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@andimak](https://discuss.elastic.co/u/andimak)\
**Post date:** [February 24, 2015, 4:41pm UTC](https://discuss.elastic.co/t/es-uri-search-on-different-values-for-same-field/22360/1 "2015-02-24T16:41:03Z")

</div>

Hello,

I am trying to search with uri and with some parameter. Imagine we have two docs:

\_source":{"nr":1,"name":"andi"}

and

\_source":{"nr":2,"name":"andy"}.

now im try an uri search and get name andi and andy as a result. In my understanding it should work like that:

localhost:9200/myindex/mytyp/\_search?q= name:andi OR name:andy & sort=nr:desc &pretty

unfortunately this doesnt work ☹ is there another way to search with an uri for both values?  
I prefer uri search !

regards  
andi

---

<div class="post-metadata">

**Author:** ![andimak](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@andimak](https://discuss.elastic.co/u/andimak)\
**Post date:** [February 24, 2015, 5:39pm UTC](https://discuss.elastic.co/t/es-uri-search-on-different-values-for-same-field/22360/2 "2015-02-24T17:39:53Z")

</div>

found it by myself:  
just set some brackets around the fields.

localhost:9200/myindex/mytyp/\_search?q= (name:andi OR name:andy) & sort=nr:desc &pretty

---

<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:** [July 6, 2017, 12:30am UTC](https://discuss.elastic.co/t/es-uri-search-on-different-values-for-same-field/22360/3 "2017-07-06T00:30:27Z")

</div>


