| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | [[query-dsl-custom-score-query]]=== Custom Score Querydeprecated[0.90.4,Replaced by <<query-dsl-function-score-query>>]`custom_score` query allows to wrap another query and customize thescoring of it optionally with a computation derived from other fieldvalues in the doc (numeric ones) using<<modules-scripting,script expression>>. Here isa simple sample:[source,js]--------------------------------------------------"custom_score" : {    "query" : {        ....    },    "script" : "_score * doc['my_numeric_field'].value"}--------------------------------------------------On top of the different scripting field values and expression, the`_score` script parameter can be used to retrieve the score based on thewrapped query.[float]==== Script ParametersScripts are cached for faster execution. If the script has parametersthat it needs to take into account, it is preferable to use the samescript, and provide parameters to it:[source,js]--------------------------------------------------"custom_score" : {    "query" : {        ....    },    "params" : {        "param1" : 2,        "param2" : 3.1    },    "script" : "_score * doc['my_numeric_field'].value / pow(param1, param2)"}--------------------------------------------------
 |