(cherry picked from commit f737290d10)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
59 lines
1.1 KiB
Plaintext
59 lines
1.1 KiB
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: "my-index-000001",
|
|
mappings: {
|
|
properties: {
|
|
metrics: {
|
|
type: "object",
|
|
subobjects: false,
|
|
properties: {
|
|
time: {
|
|
type: "long",
|
|
},
|
|
"time.min": {
|
|
type: "long",
|
|
},
|
|
"time.max": {
|
|
type: "long",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.index({
|
|
index: "my-index-000001",
|
|
id: "metric_1",
|
|
document: {
|
|
"metrics.time": 100,
|
|
"metrics.time.min": 10,
|
|
"metrics.time.max": 900,
|
|
},
|
|
});
|
|
console.log(response1);
|
|
|
|
const response2 = await client.index({
|
|
index: "my-index-000001",
|
|
id: "metric_2",
|
|
document: {
|
|
metrics: {
|
|
time: 100,
|
|
"time.min": 10,
|
|
"time.max": 900,
|
|
},
|
|
},
|
|
});
|
|
console.log(response2);
|
|
|
|
const response3 = await client.indices.getMapping({
|
|
index: "my-index-000001",
|
|
});
|
|
console.log(response3);
|
|
----
|