Files
elasticsearch-js/docs/doc_examples/44bca3f17d403517af3616754dc795bb.asciidoc
2024-07-29 17:10:05 -05:00

25 lines
728 B
Plaintext

// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await 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 ",
},
},
},
});
console.log(response);
----