1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
// This file is autogenerated, DO NOT EDIT
// query-dsl/script-score-query.asciidoc:352
[source, python]
----
resp = client.explain(
index="my-index-000001",
id="0",
query={
"script_score": {
"query": {
"match": {
"message": "elasticsearch"
}
},
"script": {
"source": "\n long count = doc['count'].value;\n double normalizedCount = count / 10;\n if (explanation != null) {\n explanation.set('normalized count = count / 10 = ' + count + ' / 10 = ' + normalizedCount);\n }\n return normalizedCount;\n "
}
}
},
)
print(resp)
----
|