# Preventing a Gauss decay function from returning 0 inside a function score query

**URL:** <https://discuss.elastic.co/t/preventing-a-gauss-decay-function-from-returning-0-inside-a-function-score-query/117462>\
**Category:** Elasticsearch\
**Created:** [January 29, 2018, 1:13pm UTC](https://discuss.elastic.co/t/preventing-a-gauss-decay-function-from-returning-0-inside-a-function-score-query/117462 "2018-01-29T13:13:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [February 4, 2018, 8:54pm UTC](https://discuss.elastic.co/t/preventing-a-gauss-decay-function-from-returning-0-inside-a-function-score-query/117462/2 "2018-02-04T20:54:00Z")

</div>

The best strategy for you is to adjust `scale` and `decay` values. For example, to distinguish between 3 year and 5 year old, increase your `scale` to something bigger, e.g : `"scale": "365d"`.

If it is not possible for you to adjust `scale` and `decay`, consider adding an arbitrary small value to your gaussian score, by introducing another function with `"score_mode" : "sum"`. Something like this: [Function\_score, gaussian decay, handling multiple by zero](https://discuss.elastic.co/t/function-score-gaussian-decay-handling-multiple-by-zero/117086/2?u=mayya)

---

_[View the full topic](https://discuss.elastic.co/t/preventing-a-gauss-decay-function-from-returning-0-inside-a-function-score-query/117462)._
