# Infinity with Range facets

**URL:** <https://discuss.elastic.co/t/infinity-with-range-facets/5446>\
**Category:** Elasticsearch\
**Created:** [September 24, 2011, 6:23am UTC](https://discuss.elastic.co/t/infinity-with-range-facets/5446 "2011-09-24T06:23:49Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [September 24, 2011, 6:23am UTC](https://discuss.elastic.co/t/infinity-with-range-facets/5446/1 "2011-09-24T06:23:49Z")

</div>

Hi,

I'm wondering why when I have no values for a given range in the range facet  
I get -Infinity for max value and +Infinity for min as this :

"montantLS" : {  
"\_type" : "range",  
"ranges" : [ {  
"to" : -10000.0,  
"count" : 0,  
"min" : "Infinity",  
"max" : "-Infinity",  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : "NaN"  
}, {  
"from" : -10000.0,  
"to" : -5000.0,  
"count" : 0,  
"min" : "Infinity",  
"max" : "-Infinity",  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : "NaN"  
}, {  
"from" : -5000.0,  
"to" : -1000.0,  
"count" : 0,  
"min" : "Infinity",  
"max" : "-Infinity",  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : "NaN"  
}, {  
"from" : -1000.0,  
"to" : -500.0,  
"count" : 0,  
"min" : "Infinity",  
"max" : "-Infinity",  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : "NaN"  
}, {  
"from" : -500.0,  
"to" : 0.0,  
"count" : 0,  
"min" : "Infinity",  
"max" : "-Infinity",  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : "NaN"  
}, {  
"from" : 0.0,  
"to" : 500.0,  
"count" : 14,  
"min" : 5.0,  
"max" : 200.0,  
"total\_count" : 14,  
"total" : 1320.0,  
"mean" : 94.28571428571429  
}, {  
"from" : 500.0,  
"to" : 1000.0,  
"count" : 6,  
"min" : 500.0,  
"max" : 800.0,  
"total\_count" : 6,  
"total" : 3400.0,  
"mean" : 566.6666666666666  
}, {  
"from" : 1000.0,  
"to" : 5000.0,  
"count" : 2,  
"min" : 1000.0,  
"max" : 2000.0,  
"total\_count" : 2,  
"total" : 3000.0,  
"mean" : 1500.0  
}, {  
"from" : 5000.0,  
"to" : 10000.0,  
"count" : 1,  
"min" : 8000.0,  
"max" : 8000.0,  
"total\_count" : 1,  
"total" : 8000.0,  
"mean" : 8000.0  
}, {  
"from" : 10000.0,  
"count" : 0,  
"min" : "Infinity",  
"max" : "-Infinity",  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : "NaN"  
} ]  
}

Is it a normal result ?

Thanks

David.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 24, 2011, 10:57am UTC](https://discuss.elastic.co/t/infinity-with-range-facets/5446/2 "2011-09-24T10:57:34Z")

</div>

Thats the default values that the min/max are initialized with, similar that  
mean is NaN. I guess we can remove those when serializing the result into  
json. Open an issue?

On Sat, Sep 24, 2011 at 9:23 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Hi,\*\*\*\*
> 
> * * *
> 
> I’m wondering why when I have no values for a given range in the range  
> facet I get -Infinity for max value and +Infinity for min as this :\*\*\*\*
> 
> * * *
> 
> "montantLS" : {  
> "\_type" : "range",  
> "ranges" : [ {  
> "to" : -10000.0,  
> "count" : 0,  
> "min" : "Infinity",  
> "max" : "-Infinity",  
> "total\_count" : 0,  
> "total" : 0.0,  
> "mean" : "NaN"  
> }, {  
> "from" : -10000.0,  
> "to" : -5000.0,  
> "count" : 0,  
> "min" : "Infinity",  
> "max" : "-Infinity",  
> "total\_count" : 0,  
> "total" : 0.0,  
> "mean" : "NaN"  
> }, {  
> "from" : -5000.0,  
> "to" : -1000.0,  
> "count" : 0,  
> "min" : "Infinity",  
> "max" : "-Infinity",  
> "total\_count" : 0,  
> "total" : 0.0,  
> "mean" : "NaN"  
> }, {  
> "from" : -1000.0,  
> "to" : -500.0,  
> "count" : 0,  
> "min" : "Infinity",  
> "max" : "-Infinity",  
> "total\_count" : 0,  
> "total" : 0.0,  
> "mean" : "NaN"  
> }, {  
> "from" : -500.0,  
> "to" : 0.0,  
> "count" : 0,  
> "min" : "Infinity",  
> "max" : "-Infinity",  
> "total\_count" : 0,  
> "total" : 0.0,  
> "mean" : "NaN"  
> }, {  
> "from" : 0.0,  
> "to" : 500.0,  
> "count" : 14,  
> "min" : 5.0,  
> "max" : 200.0,  
> "total\_count" : 14,  
> "total" : 1320.0,  
> "mean" : 94.28571428571429  
> }, {  
> "from" : 500.0,  
> "to" : 1000.0,  
> "count" : 6,  
> "min" : 500.0,  
> "max" : 800.0,  
> "total\_count" : 6,  
> "total" : 3400.0,  
> "mean" : 566.6666666666666  
> }, {  
> "from" : 1000.0,  
> "to" : 5000.0,  
> "count" : 2,  
> "min" : 1000.0,  
> "max" : 2000.0,  
> "total\_count" : 2,  
> "total" : 3000.0,  
> "mean" : 1500.0  
> }, {  
> "from" : 5000.0,  
> "to" : 10000.0,  
> "count" : 1,  
> "min" : 8000.0,  
> "max" : 8000.0,  
> "total\_count" : 1,  
> "total" : 8000.0,  
> "mean" : 8000.0  
> }, {  
> "from" : 10000.0,  
> "count" : 0,  
> "min" : "Infinity",  
> "max" : "-Infinity",  
> "total\_count" : 0,  
> "total" : 0.0,  
> "mean" : "NaN"  
> } ]  
> }\*\*\*\*
> 
> * * *
> 
> Is it a normal result ?\*\*\*\*
> 
> * * *
> 
> Thanks\*\*\*\*
> 
> David.\*\*\*\*

---

<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, 3:53am UTC](https://discuss.elastic.co/t/infinity-with-range-facets/5446/3 "2017-07-06T03:53:39Z")

</div>


