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

33 lines
639 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.search({
index: "ledger",
size: 0,
aggs: {
profit: {
scripted_metric: {
init_script: {
id: "my_init_script",
},
map_script: {
id: "my_map_script",
},
combine_script: {
id: "my_combine_script",
},
params: {
field: "amount",
},
reduce_script: {
id: "my_reduce_script",
},
},
},
},
});
console.log(response);
----