Linear function scoring question

(Or Weinberger) #1

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

(system) #2