# Elasticsearch aggregation on multi-values field?

**URL:** <https://discuss.elastic.co/t/elasticsearch-aggregation-on-multi-values-field/91792>\
**Category:** Elasticsearch\
**Created:** [July 4, 2017, 2:58pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-on-multi-values-field/91792 "2017-07-04T14:58:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mt.michael](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mt.michael](https://discuss.elastic.co/u/mt.michael)\
**Post date:** [July 4, 2017, 2:58pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-on-multi-values-field/91792/1 "2017-07-04T14:58:46Z")

</div>

Hi It seems if the field has multi-values (separate by ",") then when doing aggregation it will cause discrepancy.

Is there a way to have correct numbers?

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [July 4, 2017, 3:21pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-on-multi-values-field/91792/2 "2017-07-04T15:21:06Z")

</div>

Can you provide some more detail on your issue? Please include as much detail as possible including:

- A Sample document
- The mapping for you index
- The query you are trying to run
- An explanation of why you think there is a discrepancy between what you expect and the response you see
- The response JSON from your query

Since this will be quite a lot of JSON to paste here, please instead paste the JSON requests and responses in a [Gist](http://gist.github.com) and link to it here.

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:** [August 1, 2017, 3:21pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-on-multi-values-field/91792/3 "2017-08-01T15:21:23Z")

</div>

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