# Retrieve multiple values from one field name

**URL:** <https://discuss.elastic.co/t/retrieve-multiple-values-from-one-field-name/120078>\
**Category:** Elasticsearch\
**Created:** [February 15, 2018, 9:46pm UTC](https://discuss.elastic.co/t/retrieve-multiple-values-from-one-field-name/120078 "2018-02-15T21:46:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Ben](https://discuss.elastic.co/u/Ben)\
**Post date:** [February 15, 2018, 9:46pm UTC](https://discuss.elastic.co/t/retrieve-multiple-values-from-one-field-name/120078/1 "2018-02-15T21:46:12Z")

</div>

I have following data in elastic search

1. Index: test-1.2018
2. Field Name: "test"
3. Field value : "Test" , Test1", "Hello", "Fellow", "And other values" and so forth ...

How can I retrieve all the field values of a field type named "test" ? What query should I run ? I read questions on this forum as well as docs. But it is not clicking for some reason. Any help will be appreciated.

curl -XGET localhost:9201/test-1.\*/\_search -H 'Content-Type: application/json' -d '{  
"query": {  
"match": {  
"test": "some kind of wildcard - may be "  
}  
}  
}

Is there a way to get all the values of "test" field ? Please feel free to point me to right docs and will check it out.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 15, 2018, 10:04pm UTC](https://discuss.elastic.co/t/retrieve-multiple-values-from-one-field-name/120078/2 "2018-02-15T22:04:14Z")

</div>

Not all but the main ones may be...

You can do that with a terms aggregation I believe.

---

<div class="post-metadata">

**Author:** ![Ben](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Ben](https://discuss.elastic.co/u/Ben)\
**Post date:** [February 15, 2018, 10:54pm UTC](https://discuss.elastic.co/t/retrieve-multiple-values-from-one-field-name/120078/3 "2018-02-15T22:54:50Z")

</div>

I am using 6.1 v of es and aggregation should work as you mentioned. But i wasn't getting the results that I wanted. I guess I should try again and see if I go anywhere. Thanks.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 15, 2018, 11:06pm UTC](https://discuss.elastic.co/t/retrieve-multiple-values-from-one-field-name/120078/4 "2018-02-15T23:06:25Z")

</div>

If you don't succeed and need help, please provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

---

<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:** [March 15, 2018, 11:06pm UTC](https://discuss.elastic.co/t/retrieve-multiple-values-from-one-field-name/120078/5 "2018-03-15T23:06:30Z")

</div>

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