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

46 lines
841 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: "sales",
size: 0,
filter_path: "aggregations",
aggs: {
the_filter: {
filters: {
keyed: false,
filters: {
"t-shirt": {
term: {
type: "t-shirt",
},
},
hat: {
term: {
type: "hat",
},
},
},
},
aggs: {
avg_price: {
avg: {
field: "price",
},
},
sort_by_avg_price: {
bucket_sort: {
sort: {
avg_price: "asc",
},
},
},
},
},
},
});
console.log(response);
----