30 lines
578 B
Plaintext
30 lines
578 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: "latency",
|
|
size: 0,
|
|
runtime_mappings: {
|
|
"load_time.seconds": {
|
|
type: "long",
|
|
script: {
|
|
source: "emit(doc['load_time'].value / params.timeUnit)",
|
|
params: {
|
|
timeUnit: 1000,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
aggs: {
|
|
load_time_boxplot: {
|
|
boxplot: {
|
|
field: "load_time.seconds",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
----
|