You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Custom Score Queryedit
QueryBuilders.customScoreQuery(QueryBuilders.matchAllQuery()) // Your query here
.script("_score * doc['price'].value"); // Your script here
// If the script have parameters, use the same script and provide parameters to it.
QueryBuilders.customScoreQuery(QueryBuilders.matchAllQuery())
.script("_score * doc['price'].value / pow(param1, param2)")
.param("param1", 2)
.param("param2", 3.1);