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

46 lines
1.0 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.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);
----