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

46 lines
927 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.cluster.putComponentTemplate({
name: "ct1",
template: {
settings: {
"index.number_of_shards": 2,
},
},
});
console.log(response);
const response1 = await client.cluster.putComponentTemplate({
name: "ct2",
template: {
settings: {
"index.number_of_replicas": 0,
},
mappings: {
properties: {
"@timestamp": {
type: "date",
},
},
},
},
});
console.log(response1);
const response2 = await client.indices.putIndexTemplate({
name: "final-template",
index_patterns: ["my-index-*"],
composed_of: ["ct1", "ct2"],
priority: 5,
});
console.log(response2);
const response3 = await client.indices.simulateTemplate({
name: "final-template",
});
console.log(response3);
----