# Linear function scoring question

**URL:** <https://discuss.elastic.co/t/linear-function-scoring-question/44434>\
**Category:** Elasticsearch\
**Created:** [March 15, 2016, 1:47pm UTC](https://discuss.elastic.co/t/linear-function-scoring-question/44434 "2016-03-15T13:47:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orweinberger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orweinberger/32/580_2.png) [@orweinberger](https://discuss.elastic.co/u/orweinberger)\
**Post date:** [March 15, 2016, 1:47pm UTC](https://discuss.elastic.co/t/linear-function-scoring-question/44434/1 "2016-03-15T13:47:39Z")

</div>

I have a set of documents each with a content field and a date field. I'm trying to manipulate the score in a way that will boost newer documents.

I've found the linear decay score function but I'm having trouble understanding how it actually works.

```
"function_score": {
  "functions": [
    {
      "linear": {
        "date": {
          "scale": "30d",
          "offset": "7d",
          "decay": 0.5
        }
      }
    }
  ] 
}

```

For the above configuration, from what I understand, documents that are newer than 7 days will not have their scores manipulated, documents that are older than that will get a decrease of their score by 0.5 in intervals of 30 days, is that correct?

**Important Note: I'm using ES 1.7.4, newer ES versions have different definitions for the scale property**

---

<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, 11:08pm UTC](https://discuss.elastic.co/t/linear-function-scoring-question/44434/2 "2017-07-05T23:08:17Z")

</div>


