Custom Score Query

edit

See Custom Score Query

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);