[Backport 8.15] Added/updated snippets for docs (#2319)
(cherry picked from commit f737290d10)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
committed by
GitHub
parent
ccf9fcbd93
commit
b4eb8e5441
45
docs/doc_examples/d8fa7ca2ec8dbfa034603ea566e33f5b.asciidoc
Normal file
45
docs/doc_examples/d8fa7ca2ec8dbfa034603ea566e33f5b.asciidoc
Normal file
@ -0,0 +1,45 @@
|
||||
// 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);
|
||||
----
|
||||
Reference in New Issue
Block a user