Added/updated snippets for docs (#2318)
This commit is contained in:
40
docs/doc_examples/eaf53b05959cc6b7fb09579baf34de68.asciidoc
Normal file
40
docs/doc_examples/eaf53b05959cc6b7fb09579baf34de68.asciidoc
Normal file
@ -0,0 +1,40 @@
|
||||
// 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({
|
||||
aggs: {
|
||||
sales_per_month: {
|
||||
date_histogram: {
|
||||
field: "date",
|
||||
calendar_interval: "month",
|
||||
},
|
||||
aggs: {
|
||||
sale_type: {
|
||||
terms: {
|
||||
field: "type",
|
||||
},
|
||||
aggs: {
|
||||
sales: {
|
||||
sum: {
|
||||
field: "price",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
hat_vs_bag_ratio: {
|
||||
bucket_script: {
|
||||
buckets_path: {
|
||||
hats: "sale_type['hat']>sales",
|
||||
bags: "sale_type['bag']>sales",
|
||||
},
|
||||
script: "params.hats / params.bags",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
Reference in New Issue
Block a user