Added/updated snippets for docs (#2318)
This commit is contained in:
45
docs/doc_examples/443e8da9968f1c65f46a2a65a1e1e078.asciidoc
Normal file
45
docs/doc_examples/443e8da9968f1c65f46a2a65a1e1e078.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.indices.putIndexTemplate({
|
||||
name: "my-weather-sensor-index-template",
|
||||
index_patterns: ["metrics-weather_sensors-*"],
|
||||
data_stream: {},
|
||||
template: {
|
||||
settings: {
|
||||
"index.mode": "time_series",
|
||||
"index.lifecycle.name": "my-lifecycle-policy",
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
sensor_id: {
|
||||
type: "keyword",
|
||||
time_series_dimension: true,
|
||||
},
|
||||
location: {
|
||||
type: "keyword",
|
||||
time_series_dimension: true,
|
||||
},
|
||||
temperature: {
|
||||
type: "half_float",
|
||||
time_series_metric: "gauge",
|
||||
},
|
||||
humidity: {
|
||||
type: "half_float",
|
||||
time_series_metric: "gauge",
|
||||
},
|
||||
"@timestamp": {
|
||||
type: "date",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
priority: 500,
|
||||
_meta: {
|
||||
description: "Template for my weather sensor data",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
Reference in New Issue
Block a user