47 lines
850 B
Plaintext
47 lines
850 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.indices.create({
|
|
index: "logs",
|
|
mappings: {
|
|
_source: {
|
|
includes: ["*.count", "meta.*"],
|
|
excludes: ["meta.description", "meta.other.*"],
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.index({
|
|
index: "logs",
|
|
id: 1,
|
|
document: {
|
|
requests: {
|
|
count: 10,
|
|
foo: "bar",
|
|
},
|
|
meta: {
|
|
name: "Some metric",
|
|
description: "Some metric description",
|
|
other: {
|
|
foo: "one",
|
|
baz: "two",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response1);
|
|
|
|
const response2 = await client.search({
|
|
index: "logs",
|
|
query: {
|
|
match: {
|
|
"meta.other.foo": "one",
|
|
},
|
|
},
|
|
});
|
|
console.log(response2);
|
|
----
|