# Elastic Search Term Aggregation on numeric / long field

**URL:** <https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413>\
**Category:** Elasticsearch\
**Created:** [April 27, 2015, 10:48am UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413 "2015-04-27T10:48:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rh1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rh1](https://discuss.elastic.co/u/rh1)\
**Post date:** [April 27, 2015, 10:48am UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/1 "2015-04-27T10:48:19Z")

</div>

Hey,

I'm a little bit stucked using Terms aggregations on a numeric field.

My schema looks like that:

{ ...  
starRating:  
{

- type: "long"

}  
...  
}

I pass documents there, works fine.  
I query them, using a Range Query like, works also fine:

{  
"range": {  
"starRating": {  
"from": 0,  
"to": 5,  
}  
}  
}

Whenever I ask for Term Aggregations like:

{  
"aggs": {  
stars" : {  
"terms" : { "field" : "starRating" }  
}  
}

OR Facets with

"facets" : {  
"tag" : {  
"terms" : {  
"field" : "starRating"  
}  
}  
}

Strange values are returned:

"facets": {  
"tag": {  
"\_type": "terms",  
"missing": 0,  
"total": 3814,  
"other": 0,  
"terms": [  
{  
"term": 0.0,  
"count": 2397  
},  
{  
"term": 1.5E-323,  
"count": 610  
},  
{  
"term": 2.0E-323,  
"count": 378  
},  
{  
"term": 1.0E-323,  
"count": 269  
},  
{  
"term": 4.9E-324,  
"count": 93  
},  
{  
"term": 2.5E-323,  
"count": 67  
}  
]  
}  
},  
"aggregations": {  
"stars": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": 0.0,  
"doc\_count": 2397  
},  
{  
"key": 1.5E-323,  
"doc\_count": 610  
},  
{  
"key": 2.0E-323,  
"doc\_count": 378  
},  
{  
"key": 1.0E-323,  
"doc\_count": 269  
},  
{  
"key": 4.9E-324,  
"doc\_count": 93  
},  
{  
"key": 2.5E-323,  
"doc\_count": 67  
}  
]  
}  
}

Even in the Java Client, I get DoubleTerms instead of LongTerms.

Does anybody have an Idea, what wents wrong there. I would expect Long-Keys  
and not Double keys (which are basically close to 0)  
The Histogram (with interval of 1) also does not work, everything is close  
to the zero valued key.

Cheers, Ralf

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![deepak\_daffodil](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@deepak\_daffodil](https://discuss.elastic.co/u/deepak_daffodil)\
**Post date:** [April 27, 2015, 10:52am UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/2 "2015-04-27T10:52:29Z")

</div>

Besides the Terms filter in aggregation , you should use range aggregation .  
It would work like..

{  
"aggs": {  
stars" : {  
"range" : {  
"field" : "starRating" ,  
"ranges": [{  
"to": 5  
}, {  
"from": 5,  
"to": 10  
}, {  
"from": 10,  
"to": 15  
}, {  
"from": 15  
}]

```
       }
}

```

}

On Mon, Apr 27, 2015 at 4:18 PM, [rh@hubrick.com](mailto:rh@hubrick.com) wrote:

> Hey,
> 
> I'm a little bit stucked using Terms aggregations on a numeric field.
> 
> My schema looks like that:
> 
> { ...  
> starRating:  
> {
> 
> - type: "long"
> 
> }  
> ...  
> }
> 
> I pass documents there, works fine.  
> I query them, using a Range Query like, works also fine:
> 
> {  
> "range": {  
> "starRating": {  
> "from": 0,  
> "to": 5,  
> }  
> }  
> }
> 
> Whenever I ask for Term Aggregations like:
> 
> {  
> "aggs": {  
> stars" : {  
> "terms" : { "field" : "starRating" }  
> }  
> }
> 
> OR Facets with
> 
> "facets" : {  
> "tag" : {  
> "terms" : {  
> "field" : "starRating"  
> }  
> }  
> }
> 
> Strange values are returned:
> 
> "facets": {  
> "tag": {  
> "\_type": "terms",  
> "missing": 0,  
> "total": 3814,  
> "other": 0,  
> "terms": [  
> {  
> "term": 0.0,  
> "count": 2397  
> },  
> {  
> "term": 1.5E-323,  
> "count": 610  
> },  
> {  
> "term": 2.0E-323,  
> "count": 378  
> },  
> {  
> "term": 1.0E-323,  
> "count": 269  
> },  
> {  
> "term": 4.9E-324,  
> "count": 93  
> },  
> {  
> "term": 2.5E-323,  
> "count": 67  
> }  
> ]  
> }  
> },  
> "aggregations": {  
> "stars": {  
> "doc\_count\_error\_upper\_bound": 0,  
> "sum\_other\_doc\_count": 0,  
> "buckets": [  
> {  
> "key": 0.0,  
> "doc\_count": 2397  
> },  
> {  
> "key": 1.5E-323,  
> "doc\_count": 610  
> },  
> {  
> "key": 2.0E-323,  
> "doc\_count": 378  
> },  
> {  
> "key": 1.0E-323,  
> "doc\_count": 269  
> },  
> {  
> "key": 4.9E-324,  
> "doc\_count": 93  
> },  
> {  
> "key": 2.5E-323,  
> "doc\_count": 67  
> }  
> ]  
> }  
> }
> 
> Even in the Java Client, I get DoubleTerms instead of LongTerms.
> 
> Does anybody have an Idea, what wents wrong there. I would expect  
> Long-Keys and not Double keys (which are basically close to 0)  
> The Histogram (with interval of 1) also does not work, everything is close  
> to the zero valued key.
> 
> Cheers, Ralf
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHzCMprJiRGLs50K9o1OfdWYA65-RNFOmF-gWCOQTtSo2UB8Wg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHzCMprJiRGLs50K9o1OfdWYA65-RNFOmF-gWCOQTtSo2UB8Wg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![rh1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rh1](https://discuss.elastic.co/u/rh1)\
**Post date:** [April 27, 2015, 10:59am UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/3 "2015-04-27T10:59:02Z")

</div>

unfortunately the same "issue".  
The Ranged based Aggregation returns me:

"starRating": {  
"buckets": [  
{  
"key": "0.0-0.0",  
"from": 0.0,  
"from\_as\_string": "0.0",  
"to": 0.0,  
"to\_as\_string": "0.0",  
"doc\_count": 0  
},  
{  
"key": "1.0-1.0",  
"from": 1.0,  
"from\_as\_string": "1.0",  
"to": 1.0,  
"to\_as\_string": "1.0",  
"doc\_count": 0  
},  
{  
"key": "2.0-2.0",  
"from": 2.0,  
"from\_as\_string": "2.0",  
"to": 2.0,  
"to\_as\_string": "2.0",  
"doc\_count": 0  
},  
{  
"key": "3.0-3.0",  
"from": 3.0,  
"from\_as\_string": "3.0",  
"to": 3.0,  
"to\_as\_string": "3.0",  
"doc\_count": 0  
},  
{  
"key": "4.0-4.0",  
"from": 4.0,  
"from\_as\_string": "4.0",  
"to": 4.0,  
"to\_as\_string": "4.0",  
"doc\_count": 0  
},  
{  
"key": "5.0-5.0",  
"from": 5.0,  
"from\_as\_string": "5.0",  
"to": 5.0,  
"to\_as\_string": "5.0",  
"doc\_count": 0  
}  
]  
}

It looks like, that the values are read / indexed "wrong". Whats strange,  
the filtering by range works.

On Monday, April 27, 2015 at 12:52:35 PM UTC+2, deepak.chauhan wrote:

> Besides the Terms filter in aggregation , you should use range aggregation  
> .  
> It would work like..
> 
> {  
> "aggs": {  
> stars" : {  
> "range" : {  
> "field" : "starRating" ,  
> "ranges": [{  
> "to": 5  
> }, {  
> "from": 5,  
> "to": 10  
> }, {  
> "from": 10,  
> "to": 15  
> }, {  
> "from": 15  
> }]
> 
> ```
> }
> }
> 
> ```
> 
> }

> On Mon, Apr 27, 2015 at 4:18 PM, \<[r...@hubrick.com](mailto:r...@hubrick.com) \<javascript:\>\> wrote:
> 
> > Hey,
> > 
> > I'm a little bit stucked using Terms aggregations on a numeric field.
> > 
> > My schema looks like that:
> > 
> > { ...  
> > starRating:  
> > {
> > 
> > - type: "long"
> > 
> > }  
> > ...  
> > }
> > 
> > I pass documents there, works fine.  
> > I query them, using a Range Query like, works also fine:
> > 
> > {  
> > "range": {  
> > "starRating": {  
> > "from": 0,  
> > "to": 5,  
> > }  
> > }  
> > }
> > 
> > Whenever I ask for Term Aggregations like:
> > 
> > {  
> > "aggs": {  
> > stars" : {  
> > "terms" : { "field" : "starRating" }  
> > }  
> > }
> > 
> > OR Facets with
> > 
> > "facets" : {  
> > "tag" : {  
> > "terms" : {  
> > "field" : "starRating"  
> > }  
> > }  
> > }
> > 
> > Strange values are returned:
> > 
> > "facets": {  
> > "tag": {  
> > "\_type": "terms",  
> > "missing": 0,  
> > "total": 3814,  
> > "other": 0,  
> > "terms": [  
> > {  
> > "term": 0.0,  
> > "count": 2397  
> > },  
> > {  
> > "term": 1.5E-323,  
> > "count": 610  
> > },  
> > {  
> > "term": 2.0E-323,  
> > "count": 378  
> > },  
> > {  
> > "term": 1.0E-323,  
> > "count": 269  
> > },  
> > {  
> > "term": 4.9E-324,  
> > "count": 93  
> > },  
> > {  
> > "term": 2.5E-323,  
> > "count": 67  
> > }  
> > ]  
> > }  
> > },  
> > "aggregations": {  
> > "stars": {  
> > "doc\_count\_error\_upper\_bound": 0,  
> > "sum\_other\_doc\_count": 0,  
> > "buckets": [  
> > {  
> > "key": 0.0,  
> > "doc\_count": 2397  
> > },  
> > {  
> > "key": 1.5E-323,  
> > "doc\_count": 610  
> > },  
> > {  
> > "key": 2.0E-323,  
> > "doc\_count": 378  
> > },  
> > {  
> > "key": 1.0E-323,  
> > "doc\_count": 269  
> > },  
> > {  
> > "key": 4.9E-324,  
> > "doc\_count": 93  
> > },  
> > {  
> > "key": 2.5E-323,  
> > "doc\_count": 67  
> > }  
> > ]  
> > }  
> > }
> > 
> > Even in the Java Client, I get DoubleTerms instead of LongTerms.
> > 
> > Does anybody have an Idea, what wents wrong there. I would expect  
> > Long-Keys and not Double keys (which are basically close to 0)  
> > The Histogram (with interval of 1) also does not work, everything is  
> > close to the zero valued key.
> > 
> > Cheers, Ralf
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fed3b7c0-782d-424f-9412-ba6816ce7ffc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fed3b7c0-782d-424f-9412-ba6816ce7ffc%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![rh1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rh1](https://discuss.elastic.co/u/rh1)\
**Post date:** [April 27, 2015, 11:01am UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/4 "2015-04-27T11:01:05Z")

</div>

unfortunately the same issue, ...  
Whats strange, filtering / querying these values works as expected. I  
guess, that there is an internal mapping working unexpected.

"starRating": {  
"buckets": [  
{  
"key": "0.0-1.0",  
"from": 0.0,  
"from\_as\_string": "0.0",  
"to": 1.0,  
"to\_as\_string": "1.0",  
"doc\_count": 5119  
},  
{  
"key": "1.0-2.0",  
"from": 1.0,  
"from\_as\_string": "1.0",  
"to": 2.0,  
"to\_as\_string": "2.0",  
"doc\_count": 0  
},  
{  
"key": "2.0-3.0",  
"from": 2.0,  
"from\_as\_string": "2.0",  
"to": 3.0,  
"to\_as\_string": "3.0",  
"doc\_count": 0  
},  
{  
"key": "3.0-4.0",  
"from": 3.0,  
"from\_as\_string": "3.0",  
"to": 4.0,  
"to\_as\_string": "4.0",  
"doc\_count": 0  
},  
{  
"key": "4.0-5.0",  
"from": 4.0,  
"from\_as\_string": "4.0",  
"to": 5.0,  
"to\_as\_string": "5.0",  
"doc\_count": 0  
},  
{  
"key": "5.0-6.0",  
"from": 5.0,  
"from\_as\_string": "5.0",  
"to": 6.0,  
"to\_as\_string": "6.0",  
"doc\_count": 0  
}  
]  
}

On Monday, April 27, 2015 at 12:52:35 PM UTC+2, deepak.chauhan wrote:

> Besides the Terms filter in aggregation , you should use range aggregation  
> .  
> It would work like..
> 
> {  
> "aggs": {  
> stars" : {  
> "range" : {  
> "field" : "starRating" ,  
> "ranges": [{  
> "to": 5  
> }, {  
> "from": 5,  
> "to": 10  
> }, {  
> "from": 10,  
> "to": 15  
> }, {  
> "from": 15  
> }]
> 
> ```
> }
> }
> 
> ```
> 
> }
> 
> On Mon, Apr 27, 2015 at 4:18 PM, \<[r...@hubrick.com](mailto:r...@hubrick.com) \<javascript:\>\> wrote:
> 
> > Hey,
> > 
> > I'm a little bit stucked using Terms aggregations on a numeric field.
> > 
> > My schema looks like that:
> > 
> > { ...  
> > starRating:  
> > {
> > 
> > - type: "long"
> > 
> > }  
> > ...  
> > }
> > 
> > I pass documents there, works fine.  
> > I query them, using a Range Query like, works also fine:
> > 
> > {  
> > "range": {  
> > "starRating": {  
> > "from": 0,  
> > "to": 5,  
> > }  
> > }  
> > }
> > 
> > Whenever I ask for Term Aggregations like:
> > 
> > {  
> > "aggs": {  
> > stars" : {  
> > "terms" : { "field" : "starRating" }  
> > }  
> > }
> > 
> > OR Facets with
> > 
> > "facets" : {  
> > "tag" : {  
> > "terms" : {  
> > "field" : "starRating"  
> > }  
> > }  
> > }
> > 
> > Strange values are returned:
> > 
> > "facets": {  
> > "tag": {  
> > "\_type": "terms",  
> > "missing": 0,  
> > "total": 3814,  
> > "other": 0,  
> > "terms": [  
> > {  
> > "term": 0.0,  
> > "count": 2397  
> > },  
> > {  
> > "term": 1.5E-323,  
> > "count": 610  
> > },  
> > {  
> > "term": 2.0E-323,  
> > "count": 378  
> > },  
> > {  
> > "term": 1.0E-323,  
> > "count": 269  
> > },  
> > {  
> > "term": 4.9E-324,  
> > "count": 93  
> > },  
> > {  
> > "term": 2.5E-323,  
> > "count": 67  
> > }  
> > ]  
> > }  
> > },  
> > "aggregations": {  
> > "stars": {  
> > "doc\_count\_error\_upper\_bound": 0,  
> > "sum\_other\_doc\_count": 0,  
> > "buckets": [  
> > {  
> > "key": 0.0,  
> > "doc\_count": 2397  
> > },  
> > {  
> > "key": 1.5E-323,  
> > "doc\_count": 610  
> > },  
> > {  
> > "key": 2.0E-323,  
> > "doc\_count": 378  
> > },  
> > {  
> > "key": 1.0E-323,  
> > "doc\_count": 269  
> > },  
> > {  
> > "key": 4.9E-324,  
> > "doc\_count": 93  
> > },  
> > {  
> > "key": 2.5E-323,  
> > "doc\_count": 67  
> > }  
> > ]  
> > }  
> > }
> > 
> > Even in the Java Client, I get DoubleTerms instead of LongTerms.
> > 
> > Does anybody have an Idea, what wents wrong there. I would expect  
> > Long-Keys and not Double keys (which are basically close to 0)  
> > The Histogram (with interval of 1) also does not work, everything is  
> > close to the zero valued key.
> > 
> > Cheers, Ralf
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![deepak\_daffodil](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@deepak\_daffodil](https://discuss.elastic.co/u/deepak_daffodil)\
**Post date:** [April 27, 2015, 11:27am UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/5 "2015-04-27T11:27:02Z")

</div>

may be .. i have tried this again in my index ..  
it is working properly  
Please check your mapping  
or try on another field which is long

On Mon, Apr 27, 2015 at 4:31 PM, [rh@hubrick.com](mailto:rh@hubrick.com) wrote:

> unfortunately the same issue, ...  
> Whats strange, filtering / querying these values works as expected. I  
> guess, that there is an internal mapping working unexpected.
> 
> "starRating": {  
> "buckets": [  
> {  
> "key": "0.0-1.0",  
> "from": 0.0,  
> "from\_as\_string": "0.0",  
> "to": 1.0,  
> "to\_as\_string": "1.0",  
> "doc\_count": 5119  
> },  
> {  
> "key": "1.0-2.0",  
> "from": 1.0,  
> "from\_as\_string": "1.0",  
> "to": 2.0,  
> "to\_as\_string": "2.0",  
> "doc\_count": 0  
> },  
> {  
> "key": "2.0-3.0",  
> "from": 2.0,  
> "from\_as\_string": "2.0",  
> "to": 3.0,  
> "to\_as\_string": "3.0",  
> "doc\_count": 0  
> },  
> {  
> "key": "3.0-4.0",  
> "from": 3.0,  
> "from\_as\_string": "3.0",  
> "to": 4.0,  
> "to\_as\_string": "4.0",  
> "doc\_count": 0  
> },  
> {  
> "key": "4.0-5.0",  
> "from": 4.0,  
> "from\_as\_string": "4.0",  
> "to": 5.0,  
> "to\_as\_string": "5.0",  
> "doc\_count": 0  
> },  
> {  
> "key": "5.0-6.0",  
> "from": 5.0,  
> "from\_as\_string": "5.0",  
> "to": 6.0,  
> "to\_as\_string": "6.0",  
> "doc\_count": 0  
> }  
> ]  
> }
> 
> On Monday, April 27, 2015 at 12:52:35 PM UTC+2, deepak.chauhan wrote:
> 
> > Besides the Terms filter in aggregation , you should use range  
> > aggregation .  
> > It would work like..
> > 
> > {  
> > "aggs": {  
> > stars" : {  
> > "range" : {  
> > "field" : "starRating" ,  
> > "ranges": [{  
> > "to": 5  
> > }, {  
> > "from": 5,  
> > "to": 10  
> > }, {  
> > "from": 10,  
> > "to": 15  
> > }, {  
> > "from": 15  
> > }]
> > 
> > ```
> > }
> > }
> > 
> > ```
> > 
> > }
> > 
> > On Mon, Apr 27, 2015 at 4:18 PM, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:
> > 
> > > Hey,
> > > 
> > > I'm a little bit stucked using Terms aggregations on a numeric field.
> > > 
> > > My schema looks like that:
> > > 
> > > { ...  
> > > starRating:  
> > > {
> > > 
> > > - type: "long"
> > > 
> > > }  
> > > ...  
> > > }
> > > 
> > > I pass documents there, works fine.  
> > > I query them, using a Range Query like, works also fine:
> > > 
> > > {  
> > > "range": {  
> > > "starRating": {  
> > > "from": 0,  
> > > "to": 5,  
> > > }  
> > > }  
> > > }
> > > 
> > > Whenever I ask for Term Aggregations like:
> > > 
> > > {  
> > > "aggs": {  
> > > stars" : {  
> > > "terms" : { "field" : "starRating" }  
> > > }  
> > > }
> > > 
> > > OR Facets with
> > > 
> > > "facets" : {  
> > > "tag" : {  
> > > "terms" : {  
> > > "field" : "starRating"  
> > > }  
> > > }  
> > > }
> > > 
> > > Strange values are returned:
> > > 
> > > "facets": {  
> > > "tag": {  
> > > "\_type": "terms",  
> > > "missing": 0,  
> > > "total": 3814,  
> > > "other": 0,  
> > > "terms": [  
> > > {  
> > > "term": 0.0,  
> > > "count": 2397  
> > > },  
> > > {  
> > > "term": 1.5E-323,  
> > > "count": 610  
> > > },  
> > > {  
> > > "term": 2.0E-323,  
> > > "count": 378  
> > > },  
> > > {  
> > > "term": 1.0E-323,  
> > > "count": 269  
> > > },  
> > > {  
> > > "term": 4.9E-324,  
> > > "count": 93  
> > > },  
> > > {  
> > > "term": 2.5E-323,  
> > > "count": 67  
> > > }  
> > > ]  
> > > }  
> > > },  
> > > "aggregations": {  
> > > "stars": {  
> > > "doc\_count\_error\_upper\_bound": 0,  
> > > "sum\_other\_doc\_count": 0,  
> > > "buckets": [  
> > > {  
> > > "key": 0.0,  
> > > "doc\_count": 2397  
> > > },  
> > > {  
> > > "key": 1.5E-323,  
> > > "doc\_count": 610  
> > > },  
> > > {  
> > > "key": 2.0E-323,  
> > > "doc\_count": 378  
> > > },  
> > > {  
> > > "key": 1.0E-323,  
> > > "doc\_count": 269  
> > > },  
> > > {  
> > > "key": 4.9E-324,  
> > > "doc\_count": 93  
> > > },  
> > > {  
> > > "key": 2.5E-323,  
> > > "doc\_count": 67  
> > > }  
> > > ]  
> > > }  
> > > }
> > > 
> > > Even in the Java Client, I get DoubleTerms instead of LongTerms.
> > > 
> > > Does anybody have an Idea, what wents wrong there. I would expect  
> > > Long-Keys and not Double keys (which are basically close to 0)  
> > > The Histogram (with interval of 1) also does not work, everything is  
> > > close to the zero valued key.
> > > 
> > > Cheers, Ralf
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHzCMppvFBVAjTY9WPXZJ8dew9TjhtWcuJFGe%2BgkYRyrtkwDWw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHzCMppvFBVAjTY9WPXZJ8dew9TjhtWcuJFGe%2BgkYRyrtkwDWw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![rh1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rh1](https://discuss.elastic.co/u/rh1)\
**Post date:** [April 27, 2015, 12:17pm UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/6 "2015-04-27T12:17:54Z")

</div>

which version do you use - i'm using 1.4.4. ?

On Monday, April 27, 2015 at 1:27:12 PM UTC+2, deepak.chauhan wrote:

> may be .. i have tried this again in my index ..  
> it is working properly  
> Please check your mapping  
> or try on another field which is long
> 
> On Mon, Apr 27, 2015 at 4:31 PM, \<[r...@hubrick.com](mailto:r...@hubrick.com) \<javascript:\>\> wrote:
> 
> > unfortunately the same issue, ...  
> > Whats strange, filtering / querying these values works as expected. I  
> > guess, that there is an internal mapping working unexpected.
> > 
> > "starRating": {  
> > "buckets": [  
> > {  
> > "key": "0.0-1.0",  
> > "from": 0.0,  
> > "from\_as\_string": "0.0",  
> > "to": 1.0,  
> > "to\_as\_string": "1.0",  
> > "doc\_count": 5119  
> > },  
> > {  
> > "key": "1.0-2.0",  
> > "from": 1.0,  
> > "from\_as\_string": "1.0",  
> > "to": 2.0,  
> > "to\_as\_string": "2.0",  
> > "doc\_count": 0  
> > },  
> > {  
> > "key": "2.0-3.0",  
> > "from": 2.0,  
> > "from\_as\_string": "2.0",  
> > "to": 3.0,  
> > "to\_as\_string": "3.0",  
> > "doc\_count": 0  
> > },  
> > {  
> > "key": "3.0-4.0",  
> > "from": 3.0,  
> > "from\_as\_string": "3.0",  
> > "to": 4.0,  
> > "to\_as\_string": "4.0",  
> > "doc\_count": 0  
> > },  
> > {  
> > "key": "4.0-5.0",  
> > "from": 4.0,  
> > "from\_as\_string": "4.0",  
> > "to": 5.0,  
> > "to\_as\_string": "5.0",  
> > "doc\_count": 0  
> > },  
> > {  
> > "key": "5.0-6.0",  
> > "from": 5.0,  
> > "from\_as\_string": "5.0",  
> > "to": 6.0,  
> > "to\_as\_string": "6.0",  
> > "doc\_count": 0  
> > }  
> > ]  
> > }
> > 
> > On Monday, April 27, 2015 at 12:52:35 PM UTC+2, deepak.chauhan wrote:
> > 
> > > Besides the Terms filter in aggregation , you should use range  
> > > aggregation .  
> > > It would work like..
> > > 
> > > {  
> > > "aggs": {  
> > > stars" : {  
> > > "range" : {  
> > > "field" : "starRating" ,  
> > > "ranges": [{  
> > > "to": 5  
> > > }, {  
> > > "from": 5,  
> > > "to": 10  
> > > }, {  
> > > "from": 10,  
> > > "to": 15  
> > > }, {  
> > > "from": 15  
> > > }]
> > > 
> > > ```
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > }
> > > 
> > > On Mon, Apr 27, 2015 at 4:18 PM, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:
> > > 
> > > > Hey,
> > > > 
> > > > I'm a little bit stucked using Terms aggregations on a numeric field.
> > > > 
> > > > My schema looks like that:
> > > > 
> > > > { ...  
> > > > starRating:  
> > > > {
> > > > 
> > > > - type: "long"
> > > > 
> > > > }  
> > > > ...  
> > > > }
> > > > 
> > > > I pass documents there, works fine.  
> > > > I query them, using a Range Query like, works also fine:
> > > > 
> > > > {  
> > > > "range": {  
> > > > "starRating": {  
> > > > "from": 0,  
> > > > "to": 5,  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > Whenever I ask for Term Aggregations like:
> > > > 
> > > > {  
> > > > "aggs": {  
> > > > stars" : {  
> > > > "terms" : { "field" : "starRating" }  
> > > > }  
> > > > }
> > > > 
> > > > OR Facets with
> > > > 
> > > > "facets" : {  
> > > > "tag" : {  
> > > > "terms" : {  
> > > > "field" : "starRating"  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > Strange values are returned:
> > > > 
> > > > "facets": {  
> > > > "tag": {  
> > > > "\_type": "terms",  
> > > > "missing": 0,  
> > > > "total": 3814,  
> > > > "other": 0,  
> > > > "terms": [  
> > > > {  
> > > > "term": 0.0,  
> > > > "count": 2397  
> > > > },  
> > > > {  
> > > > "term": 1.5E-323,  
> > > > "count": 610  
> > > > },  
> > > > {  
> > > > "term": 2.0E-323,  
> > > > "count": 378  
> > > > },  
> > > > {  
> > > > "term": 1.0E-323,  
> > > > "count": 269  
> > > > },  
> > > > {  
> > > > "term": 4.9E-324,  
> > > > "count": 93  
> > > > },  
> > > > {  
> > > > "term": 2.5E-323,  
> > > > "count": 67  
> > > > }  
> > > > ]  
> > > > }  
> > > > },  
> > > > "aggregations": {  
> > > > "stars": {  
> > > > "doc\_count\_error\_upper\_bound": 0,  
> > > > "sum\_other\_doc\_count": 0,  
> > > > "buckets": [  
> > > > {  
> > > > "key": 0.0,  
> > > > "doc\_count": 2397  
> > > > },  
> > > > {  
> > > > "key": 1.5E-323,  
> > > > "doc\_count": 610  
> > > > },  
> > > > {  
> > > > "key": 2.0E-323,  
> > > > "doc\_count": 378  
> > > > },  
> > > > {  
> > > > "key": 1.0E-323,  
> > > > "doc\_count": 269  
> > > > },  
> > > > {  
> > > > "key": 4.9E-324,  
> > > > "doc\_count": 93  
> > > > },  
> > > > {  
> > > > "key": 2.5E-323,  
> > > > "doc\_count": 67  
> > > > }  
> > > > ]  
> > > > }  
> > > > }
> > > > 
> > > > Even in the Java Client, I get DoubleTerms instead of LongTerms.
> > > > 
> > > > Does anybody have an Idea, what wents wrong there. I would expect  
> > > > Long-Keys and not Double keys (which are basically close to 0)  
> > > > The Histogram (with interval of 1) also does not work, everything is  
> > > > close to the zero valued key.
> > > > 
> > > > Cheers, Ralf
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![deepak\_daffodil](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@deepak\_daffodil](https://discuss.elastic.co/u/deepak_daffodil)\
**Post date:** [April 27, 2015, 12:29pm UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/7 "2015-04-27T12:29:49Z")

</div>

yeah may be due to that  
..  
i am using 1.4.2

On Mon, Apr 27, 2015 at 5:47 PM, [rh@hubrick.com](mailto:rh@hubrick.com) wrote:

> which version do you use - i'm using 1.4.4. ?
> 
> On Monday, April 27, 2015 at 1:27:12 PM UTC+2, deepak.chauhan wrote:
> 
> > may be .. i have tried this again in my index ..  
> > it is working properly  
> > Please check your mapping  
> > or try on another field which is long
> > 
> > On Mon, Apr 27, 2015 at 4:31 PM, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:
> > 
> > > unfortunately the same issue, ...  
> > > Whats strange, filtering / querying these values works as expected. I  
> > > guess, that there is an internal mapping working unexpected.
> > > 
> > > "starRating": {  
> > > "buckets": [  
> > > {  
> > > "key": "0.0-1.0",  
> > > "from": 0.0,  
> > > "from\_as\_string": "0.0",  
> > > "to": 1.0,  
> > > "to\_as\_string": "1.0",  
> > > "doc\_count": 5119  
> > > },  
> > > {  
> > > "key": "1.0-2.0",  
> > > "from": 1.0,  
> > > "from\_as\_string": "1.0",  
> > > "to": 2.0,  
> > > "to\_as\_string": "2.0",  
> > > "doc\_count": 0  
> > > },  
> > > {  
> > > "key": "2.0-3.0",  
> > > "from": 2.0,  
> > > "from\_as\_string": "2.0",  
> > > "to": 3.0,  
> > > "to\_as\_string": "3.0",  
> > > "doc\_count": 0  
> > > },  
> > > {  
> > > "key": "3.0-4.0",  
> > > "from": 3.0,  
> > > "from\_as\_string": "3.0",  
> > > "to": 4.0,  
> > > "to\_as\_string": "4.0",  
> > > "doc\_count": 0  
> > > },  
> > > {  
> > > "key": "4.0-5.0",  
> > > "from": 4.0,  
> > > "from\_as\_string": "4.0",  
> > > "to": 5.0,  
> > > "to\_as\_string": "5.0",  
> > > "doc\_count": 0  
> > > },  
> > > {  
> > > "key": "5.0-6.0",  
> > > "from": 5.0,  
> > > "from\_as\_string": "5.0",  
> > > "to": 6.0,  
> > > "to\_as\_string": "6.0",  
> > > "doc\_count": 0  
> > > }  
> > > ]  
> > > }
> > > 
> > > On Monday, April 27, 2015 at 12:52:35 PM UTC+2, deepak.chauhan wrote:
> > > 
> > > > Besides the Terms filter in aggregation , you should use range  
> > > > aggregation .  
> > > > It would work like..
> > > > 
> > > > {  
> > > > "aggs": {  
> > > > stars" : {  
> > > > "range" : {  
> > > > "field" : "starRating" ,  
> > > > "ranges": [{  
> > > > "to": 5  
> > > > }, {  
> > > > "from": 5,  
> > > > "to": 10  
> > > > }, {  
> > > > "from": 10,  
> > > > "to": 15  
> > > > }, {  
> > > > "from": 15  
> > > > }]
> > > > 
> > > > ```
> > > > }
> > > > }
> > > > 
> > > > ```
> > > > 
> > > > }
> > > > 
> > > > On Mon, Apr 27, 2015 at 4:18 PM, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:
> > > > 
> > > > > Hey,
> > > > > 
> > > > > I'm a little bit stucked using Terms aggregations on a numeric field.
> > > > > 
> > > > > My schema looks like that:
> > > > > 
> > > > > { ...  
> > > > > starRating:  
> > > > > {
> > > > > 
> > > > > - type: "long"
> > > > > 
> > > > > }  
> > > > > ...  
> > > > > }
> > > > > 
> > > > > I pass documents there, works fine.  
> > > > > I query them, using a Range Query like, works also fine:
> > > > > 
> > > > > {  
> > > > > "range": {  
> > > > > "starRating": {  
> > > > > "from": 0,  
> > > > > "to": 5,  
> > > > > }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > Whenever I ask for Term Aggregations like:
> > > > > 
> > > > > {  
> > > > > "aggs": {  
> > > > > stars" : {  
> > > > > "terms" : { "field" : "starRating" }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > OR Facets with
> > > > > 
> > > > > "facets" : {  
> > > > > "tag" : {  
> > > > > "terms" : {  
> > > > > "field" : "starRating"  
> > > > > }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > Strange values are returned:
> > > > > 
> > > > > "facets": {  
> > > > > "tag": {  
> > > > > "\_type": "terms",  
> > > > > "missing": 0,  
> > > > > "total": 3814,  
> > > > > "other": 0,  
> > > > > "terms": [  
> > > > > {  
> > > > > "term": 0.0,  
> > > > > "count": 2397  
> > > > > },  
> > > > > {  
> > > > > "term": 1.5E-323,  
> > > > > "count": 610  
> > > > > },  
> > > > > {  
> > > > > "term": 2.0E-323,  
> > > > > "count": 378  
> > > > > },  
> > > > > {  
> > > > > "term": 1.0E-323,  
> > > > > "count": 269  
> > > > > },  
> > > > > {  
> > > > > "term": 4.9E-324,  
> > > > > "count": 93  
> > > > > },  
> > > > > {  
> > > > > "term": 2.5E-323,  
> > > > > "count": 67  
> > > > > }  
> > > > > ]  
> > > > > }  
> > > > > },  
> > > > > "aggregations": {  
> > > > > "stars": {  
> > > > > "doc\_count\_error\_upper\_bound": 0,  
> > > > > "sum\_other\_doc\_count": 0,  
> > > > > "buckets": [  
> > > > > {  
> > > > > "key": 0.0,  
> > > > > "doc\_count": 2397  
> > > > > },  
> > > > > {  
> > > > > "key": 1.5E-323,  
> > > > > "doc\_count": 610  
> > > > > },  
> > > > > {  
> > > > > "key": 2.0E-323,  
> > > > > "doc\_count": 378  
> > > > > },  
> > > > > {  
> > > > > "key": 1.0E-323,  
> > > > > "doc\_count": 269  
> > > > > },  
> > > > > {  
> > > > > "key": 4.9E-324,  
> > > > > "doc\_count": 93  
> > > > > },  
> > > > > {  
> > > > > "key": 2.5E-323,  
> > > > > "doc\_count": 67  
> > > > > }  
> > > > > ]  
> > > > > }  
> > > > > }
> > > > > 
> > > > > Even in the Java Client, I get DoubleTerms instead of LongTerms.
> > > > > 
> > > > > Does anybody have an Idea, what wents wrong there. I would expect  
> > > > > Long-Keys and not Double keys (which are basically close to 0)  
> > > > > The Histogram (with interval of 1) also does not work, everything is  
> > > > > close to the zero valued key.
> > > > > 
> > > > > Cheers, Ralf
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHzCMpotCzVQAn%2Bc3cdnA1SHZe05aO3LqmTR9HUdbgvE\_KhFKQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHzCMpotCzVQAn%2Bc3cdnA1SHZe05aO3LqmTR9HUdbgvE_KhFKQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![deepak\_daffodil](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@deepak\_daffodil](https://discuss.elastic.co/u/deepak_daffodil)\
**Post date:** [April 27, 2015, 12:31pm UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/8 "2015-04-27T12:31:38Z")

</div>

i have also tried on 1.5.1 , it is woring properly

On Mon, Apr 27, 2015 at 5:59 PM, Deepak Chauhan \<  
[deepak.chauhan@daffodilsw.com](mailto:deepak.chauhan@daffodilsw.com)\> wrote:

> yeah may be due to that  
> ..  
> i am using 1.4.2
> 
> On Mon, Apr 27, 2015 at 5:47 PM, [rh@hubrick.com](mailto:rh@hubrick.com) wrote:
> 
> > which version do you use - i'm using 1.4.4. ?
> > 
> > On Monday, April 27, 2015 at 1:27:12 PM UTC+2, deepak.chauhan wrote:
> > 
> > > may be .. i have tried this again in my index ..  
> > > it is working properly  
> > > Please check your mapping  
> > > or try on another field which is long
> > > 
> > > On Mon, Apr 27, 2015 at 4:31 PM, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:
> > > 
> > > > unfortunately the same issue, ...  
> > > > Whats strange, filtering / querying these values works as expected. I  
> > > > guess, that there is an internal mapping working unexpected.
> > > > 
> > > > "starRating": {  
> > > > "buckets": [  
> > > > {  
> > > > "key": "0.0-1.0",  
> > > > "from": 0.0,  
> > > > "from\_as\_string": "0.0",  
> > > > "to": 1.0,  
> > > > "to\_as\_string": "1.0",  
> > > > "doc\_count": 5119  
> > > > },  
> > > > {  
> > > > "key": "1.0-2.0",  
> > > > "from": 1.0,  
> > > > "from\_as\_string": "1.0",  
> > > > "to": 2.0,  
> > > > "to\_as\_string": "2.0",  
> > > > "doc\_count": 0  
> > > > },  
> > > > {  
> > > > "key": "2.0-3.0",  
> > > > "from": 2.0,  
> > > > "from\_as\_string": "2.0",  
> > > > "to": 3.0,  
> > > > "to\_as\_string": "3.0",  
> > > > "doc\_count": 0  
> > > > },  
> > > > {  
> > > > "key": "3.0-4.0",  
> > > > "from": 3.0,  
> > > > "from\_as\_string": "3.0",  
> > > > "to": 4.0,  
> > > > "to\_as\_string": "4.0",  
> > > > "doc\_count": 0  
> > > > },  
> > > > {  
> > > > "key": "4.0-5.0",  
> > > > "from": 4.0,  
> > > > "from\_as\_string": "4.0",  
> > > > "to": 5.0,  
> > > > "to\_as\_string": "5.0",  
> > > > "doc\_count": 0  
> > > > },  
> > > > {  
> > > > "key": "5.0-6.0",  
> > > > "from": 5.0,  
> > > > "from\_as\_string": "5.0",  
> > > > "to": 6.0,  
> > > > "to\_as\_string": "6.0",  
> > > > "doc\_count": 0  
> > > > }  
> > > > ]  
> > > > }
> > > > 
> > > > On Monday, April 27, 2015 at 12:52:35 PM UTC+2, deepak.chauhan wrote:
> > > > 
> > > > > Besides the Terms filter in aggregation , you should use range  
> > > > > aggregation .  
> > > > > It would work like..
> > > > > 
> > > > > {  
> > > > > "aggs": {  
> > > > > stars" : {  
> > > > > "range" : {  
> > > > > "field" : "starRating" ,  
> > > > > "ranges": [{  
> > > > > "to": 5  
> > > > > }, {  
> > > > > "from": 5,  
> > > > > "to": 10  
> > > > > }, {  
> > > > > "from": 10,  
> > > > > "to": 15  
> > > > > }, {  
> > > > > "from": 15  
> > > > > }]
> > > > > 
> > > > > ```
> > > > > }
> > > > > }
> > > > > 
> > > > > ```
> > > > > 
> > > > > }
> > > > > 
> > > > > On Mon, Apr 27, 2015 at 4:18 PM, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:
> > > > > 
> > > > > > Hey,
> > > > > > 
> > > > > > I'm a little bit stucked using Terms aggregations on a numeric field.
> > > > > > 
> > > > > > My schema looks like that:
> > > > > > 
> > > > > > { ...  
> > > > > > starRating:  
> > > > > > {
> > > > > > 
> > > > > > - type: "long"
> > > > > > 
> > > > > > }  
> > > > > > ...  
> > > > > > }
> > > > > > 
> > > > > > I pass documents there, works fine.  
> > > > > > I query them, using a Range Query like, works also fine:
> > > > > > 
> > > > > > {  
> > > > > > "range": {  
> > > > > > "starRating": {  
> > > > > > "from": 0,  
> > > > > > "to": 5,  
> > > > > > }  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > Whenever I ask for Term Aggregations like:
> > > > > > 
> > > > > > {  
> > > > > > "aggs": {  
> > > > > > stars" : {  
> > > > > > "terms" : { "field" : "starRating" }  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > OR Facets with
> > > > > > 
> > > > > > "facets" : {  
> > > > > > "tag" : {  
> > > > > > "terms" : {  
> > > > > > "field" : "starRating"  
> > > > > > }  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > Strange values are returned:
> > > > > > 
> > > > > > "facets": {  
> > > > > > "tag": {  
> > > > > > "\_type": "terms",  
> > > > > > "missing": 0,  
> > > > > > "total": 3814,  
> > > > > > "other": 0,  
> > > > > > "terms": [  
> > > > > > {  
> > > > > > "term": 0.0,  
> > > > > > "count": 2397  
> > > > > > },  
> > > > > > {  
> > > > > > "term": 1.5E-323,  
> > > > > > "count": 610  
> > > > > > },  
> > > > > > {  
> > > > > > "term": 2.0E-323,  
> > > > > > "count": 378  
> > > > > > },  
> > > > > > {  
> > > > > > "term": 1.0E-323,  
> > > > > > "count": 269  
> > > > > > },  
> > > > > > {  
> > > > > > "term": 4.9E-324,  
> > > > > > "count": 93  
> > > > > > },  
> > > > > > {  
> > > > > > "term": 2.5E-323,  
> > > > > > "count": 67  
> > > > > > }  
> > > > > > ]  
> > > > > > }  
> > > > > > },  
> > > > > > "aggregations": {  
> > > > > > "stars": {  
> > > > > > "doc\_count\_error\_upper\_bound": 0,  
> > > > > > "sum\_other\_doc\_count": 0,  
> > > > > > "buckets": [  
> > > > > > {  
> > > > > > "key": 0.0,  
> > > > > > "doc\_count": 2397  
> > > > > > },  
> > > > > > {  
> > > > > > "key": 1.5E-323,  
> > > > > > "doc\_count": 610  
> > > > > > },  
> > > > > > {  
> > > > > > "key": 2.0E-323,  
> > > > > > "doc\_count": 378  
> > > > > > },  
> > > > > > {  
> > > > > > "key": 1.0E-323,  
> > > > > > "doc\_count": 269  
> > > > > > },  
> > > > > > {  
> > > > > > "key": 4.9E-324,  
> > > > > > "doc\_count": 93  
> > > > > > },  
> > > > > > {  
> > > > > > "key": 2.5E-323,  
> > > > > > "doc\_count": 67  
> > > > > > }  
> > > > > > ]  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > Even in the Java Client, I get DoubleTerms instead of LongTerms.
> > > > > > 
> > > > > > Does anybody have an Idea, what wents wrong there. I would expect  
> > > > > > Long-Keys and not Double keys (which are basically close to 0)  
> > > > > > The Histogram (with interval of 1) also does not work, everything is  
> > > > > > close to the zero valued key.
> > > > > > 
> > > > > > Cheers, Ralf
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > To view this discussion on the web visit  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com)  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7c604a6a-aaf8-4645-903b-d9472868b1bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .  
> > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/831df5f8-a5d3-4c90-b4c7-d40f12df514d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c8c251f4-00f6-4229-b7f2-760ec3b0d6db%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHzCMppeTOeGBCYBQj%3DrZkZ-GjvTiU7p8SKXH3zMq22jF3uN\_g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHzCMppeTOeGBCYBQj%3DrZkZ-GjvTiU7p8SKXH3zMq22jF3uN_g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![rh1](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rh1](https://discuss.elastic.co/u/rh1)\
**Post date:** [April 27, 2015, 12:45pm UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/9 "2015-04-27T12:45:07Z")

</div>

problem solved, when switching to 1.5.0+

On Monday, April 27, 2015 at 12:48:19 PM UTC+2, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:

> Hey,
> 
> I'm a little bit stucked using Terms aggregations on a numeric field.
> 
> My schema looks like that:
> 
> { ...  
> starRating:  
> {
> 
> - type: "long"
> 
> }  
> ...  
> }
> 
> I pass documents there, works fine.  
> I query them, using a Range Query like, works also fine:
> 
> {  
> "range": {  
> "starRating": {  
> "from": 0,  
> "to": 5,  
> }  
> }  
> }
> 
> Whenever I ask for Term Aggregations like:
> 
> {  
> "aggs": {  
> stars" : {  
> "terms" : { "field" : "starRating" }  
> }  
> }
> 
> OR Facets with
> 
> "facets" : {  
> "tag" : {  
> "terms" : {  
> "field" : "starRating"  
> }  
> }  
> }
> 
> Strange values are returned:
> 
> "facets": {  
> "tag": {  
> "\_type": "terms",  
> "missing": 0,  
> "total": 3814,  
> "other": 0,  
> "terms": [  
> {  
> "term": 0.0,  
> "count": 2397  
> },  
> {  
> "term": 1.5E-323,  
> "count": 610  
> },  
> {  
> "term": 2.0E-323,  
> "count": 378  
> },  
> {  
> "term": 1.0E-323,  
> "count": 269  
> },  
> {  
> "term": 4.9E-324,  
> "count": 93  
> },  
> {  
> "term": 2.5E-323,  
> "count": 67  
> }  
> ]  
> }  
> },  
> "aggregations": {  
> "stars": {  
> "doc\_count\_error\_upper\_bound": 0,  
> "sum\_other\_doc\_count": 0,  
> "buckets": [  
> {  
> "key": 0.0,  
> "doc\_count": 2397  
> },  
> {  
> "key": 1.5E-323,  
> "doc\_count": 610  
> },  
> {  
> "key": 2.0E-323,  
> "doc\_count": 378  
> },  
> {  
> "key": 1.0E-323,  
> "doc\_count": 269  
> },  
> {  
> "key": 4.9E-324,  
> "doc\_count": 93  
> },  
> {  
> "key": 2.5E-323,  
> "doc\_count": 67  
> }  
> ]  
> }  
> }
> 
> Even in the Java Client, I get DoubleTerms instead of LongTerms.
> 
> Does anybody have an Idea, what wents wrong there. I would expect  
> Long-Keys and not Double keys (which are basically close to 0)  
> The Histogram (with interval of 1) also does not work, everything is close  
> to the zero valued key.
> 
> Cheers, Ralf

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9fb08d23-49ee-4baa-8df8-247797e0dee9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9fb08d23-49ee-4baa-8df8-247797e0dee9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![deepak\_daffodil](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@deepak\_daffodil](https://discuss.elastic.co/u/deepak_daffodil)\
**Post date:** [April 27, 2015, 12:46pm UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/10 "2015-04-27T12:46:05Z")

</div>

Okk ,Congratulation buddy

On Mon, Apr 27, 2015 at 6:15 PM, [rh@hubrick.com](mailto:rh@hubrick.com) wrote:

> problem solved, when switching to 1.5.0+
> 
> On Monday, April 27, 2015 at 12:48:19 PM UTC+2, [r...@hubrick.com](mailto:r...@hubrick.com) wrote:
> 
> > Hey,
> > 
> > I'm a little bit stucked using Terms aggregations on a numeric field.
> > 
> > My schema looks like that:
> > 
> > { ...  
> > starRating:  
> > {
> > 
> > - type: "long"
> > 
> > }  
> > ...  
> > }
> > 
> > I pass documents there, works fine.  
> > I query them, using a Range Query like, works also fine:
> > 
> > {  
> > "range": {  
> > "starRating": {  
> > "from": 0,  
> > "to": 5,  
> > }  
> > }  
> > }
> > 
> > Whenever I ask for Term Aggregations like:
> > 
> > {  
> > "aggs": {  
> > stars" : {  
> > "terms" : { "field" : "starRating" }  
> > }  
> > }
> > 
> > OR Facets with
> > 
> > "facets" : {  
> > "tag" : {  
> > "terms" : {  
> > "field" : "starRating"  
> > }  
> > }  
> > }
> > 
> > Strange values are returned:
> > 
> > "facets": {  
> > "tag": {  
> > "\_type": "terms",  
> > "missing": 0,  
> > "total": 3814,  
> > "other": 0,  
> > "terms": [  
> > {  
> > "term": 0.0,  
> > "count": 2397  
> > },  
> > {  
> > "term": 1.5E-323,  
> > "count": 610  
> > },  
> > {  
> > "term": 2.0E-323,  
> > "count": 378  
> > },  
> > {  
> > "term": 1.0E-323,  
> > "count": 269  
> > },  
> > {  
> > "term": 4.9E-324,  
> > "count": 93  
> > },  
> > {  
> > "term": 2.5E-323,  
> > "count": 67  
> > }  
> > ]  
> > }  
> > },  
> > "aggregations": {  
> > "stars": {  
> > "doc\_count\_error\_upper\_bound": 0,  
> > "sum\_other\_doc\_count": 0,  
> > "buckets": [  
> > {  
> > "key": 0.0,  
> > "doc\_count": 2397  
> > },  
> > {  
> > "key": 1.5E-323,  
> > "doc\_count": 610  
> > },  
> > {  
> > "key": 2.0E-323,  
> > "doc\_count": 378  
> > },  
> > {  
> > "key": 1.0E-323,  
> > "doc\_count": 269  
> > },  
> > {  
> > "key": 4.9E-324,  
> > "doc\_count": 93  
> > },  
> > {  
> > "key": 2.5E-323,  
> > "doc\_count": 67  
> > }  
> > ]  
> > }  
> > }
> > 
> > Even in the Java Client, I get DoubleTerms instead of LongTerms.
> > 
> > Does anybody have an Idea, what wents wrong there. I would expect  
> > Long-Keys and not Double keys (which are basically close to 0)  
> > The Histogram (with interval of 1) also does not work, everything is  
> > close to the zero valued key.
> > 
> > Cheers, Ralf
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/9fb08d23-49ee-4baa-8df8-247797e0dee9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9fb08d23-49ee-4baa-8df8-247797e0dee9%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/9fb08d23-49ee-4baa-8df8-247797e0dee9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9fb08d23-49ee-4baa-8df8-247797e0dee9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHzCMpoqkTnDab513ZPY-B7VqkHjqVsQC0ACrE%3DOEe6rD9Rtaw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHzCMpoqkTnDab513ZPY-B7VqkHjqVsQC0ACrE%3DOEe6rD9Rtaw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:17am UTC](https://discuss.elastic.co/t/elastic-search-term-aggregation-on-numeric-long-field/23413/11 "2017-07-06T00:17:37Z")

</div>


