All about Scripting

Instead, you can now use:

POST /imdb/_search?pretty
{
  "query": {
    "function_score": {
      "query": {"match_all": {}},
      "functions": [
        {
          "field_value_factor": {
            "field": "popularity",
            "factor": 1.5,
            "modifier": "log"
          }
        }
      ]
    }
  }
}

This not only requires no scripting, but is faster because the execution can use native paths instead of compiling and executing an MVEL or Groovy script. Keep the field_value_factor function in mind as a faster alternative to scripting!

Sign up for updates!