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

25 lines
508 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,
runtime_mappings: {
type_and_promoted: {
type: "keyword",
script: "emit(doc['type'].value + ' ' + doc['promoted'].value)",
},
},
aggs: {
type_promoted_count: {
cardinality: {
field: "type_and_promoted",
},
},
},
});
console.log(response);
----