# Decay function returning documents where the freshness column is not present

**URL:** <https://discuss.elastic.co/t/decay-function-returning-documents-where-the-freshness-column-is-not-present/62208>\
**Category:** Elasticsearch\
**Created:** [October 4, 2016, 6:41pm UTC](https://discuss.elastic.co/t/decay-function-returning-documents-where-the-freshness-column-is-not-present/62208 "2016-10-04T18:41:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_B](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Pradeep\_B](https://discuss.elastic.co/u/Pradeep_B)\
**Post date:** [October 4, 2016, 6:41pm UTC](https://discuss.elastic.co/t/decay-function-returning-documents-where-the-freshness-column-is-not-present/62208/1 "2016-10-04T18:41:41Z")

</div>

Hi All,  
I am trying to create a Guassian decay function on top of a data field : lastUpdatedDate. However, this field is not present in all the documents.  
when i model my query like below, i observe that the returned results at the top are the ones in which the field is not present in the document. How to tweak this behaviour to actually incentivize the documents which have the date captured ?

POST /test\_index/\_search  
{  
"query": {  
"function\_score": {  
"query": {  
"match": {  
"name": "ACME"  
}  
},  
"guass": {  
"lastUpdatedDate": {  
"scale": "6w"  
}  
}  
}  
}  
}

---

<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 5, 2017, 10:15pm UTC](https://discuss.elastic.co/t/decay-function-returning-documents-where-the-freshness-column-is-not-present/62208/2 "2017-07-05T22:15:01Z")

</div>


