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

54 lines
774 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.bulk({
index: "test",
refresh: "true",
operations: [
{
index: {},
},
{
s: 1,
m: 3.1415,
},
{
index: {},
},
{
s: 2,
m: 1,
},
{
index: {},
},
{
s: 3,
m: 2.71828,
},
],
});
console.log(response);
const response1 = await client.search({
index: "test",
filter_path: "aggregations",
aggs: {
tm: {
top_metrics: {
metrics: {
field: "m",
},
sort: {
s: "desc",
},
size: 3,
},
},
},
});
console.log(response1);
----