# "Infinity" value as "origin" for a Gauss function, scores NaN

**URL:** <https://discuss.elastic.co/t/infinity-value-as-origin-for-a-gauss-function-scores-nan/23733>\
**Category:** Elasticsearch\
**Created:** [June 1, 2015, 10:39am UTC](https://discuss.elastic.co/t/infinity-value-as-origin-for-a-gauss-function-scores-nan/23733 "2015-06-01T10:39:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicola\_Dalmasso](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@Nicola\_Dalmasso](https://discuss.elastic.co/u/Nicola_Dalmasso)\
**Post date:** [June 1, 2015, 10:39am UTC](https://discuss.elastic.co/t/infinity-value-as-origin-for-a-gauss-function-scores-nan/23733/1 "2015-06-01T10:39:41Z")

</div>

I have to score a property (download allowance for a broadband package  
expressed in GB) which can have values like 1, 2, 10, 20 and Infinity.  
I want to use a Gauss scoring function.

{  
"gauss":{  
"services.Broadband.downloadAllowance.value":{  
"origin":"Infinity",  
"scale":50  
}  
}  
}

the \_explain api returns this:

- {
  - "value": "NaN",
  - "description": "function score, product of:",
  - 

"details": [  
-  
{  
- "value": 1,  
- "description": "match filter: _:_"  
},  
-  
{  
- "value": "NaN",  
- "description": "Function for field  
services.Broadband.downloadAllowance.value:",  
-  
"details": [  
-  
{  
- "value": "NaN",  
- "description": "exp(-0.5\*pow(MIN of:  
[Math.max(Math.abs(Infinity(=doc value) - Infinity(=origin))) -  
0.0(=offset), 0)],2.0)/1803.3688011112042)"  
}  
]  
}  
]  
}

It does recognize the Infinity word (it parses the query correctly) but  
produces a NaN score.

Any suggestion to the approach to use?

For the sake of completeness, we are using a workaround, using another  
field with a value of 999 when the value is Infinity, so the Gauss curve  
works properly, but it's a workaround and we would like to be able to deal  
with the "Infinity" value, which works great in Js.

Thanks for your time!

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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/c5bc935d-5763-4972-af33-435387f090c7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c5bc935d-5763-4972-af33-435387f090c7%40googlegroups.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:10am UTC](https://discuss.elastic.co/t/infinity-value-as-origin-for-a-gauss-function-scores-nan/23733/2 "2017-07-06T00:10:31Z")

</div>


