[Backport 8.15] Added/updated snippets for docs (#2319)
(cherry picked from commit f737290d10)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
committed by
GitHub
parent
ccf9fcbd93
commit
b4eb8e5441
32
docs/doc_examples/cd38c601ab293a6ec0e2df71d0c96b58.asciidoc
Normal file
32
docs/doc_examples/cd38c601ab293a6ec0e2df71d0c96b58.asciidoc
Normal file
@ -0,0 +1,32 @@
|
||||
// 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: "template_with_2_shards",
|
||||
template: {
|
||||
settings: {
|
||||
"index.number_of_shards": 2,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.cluster.putComponentTemplate({
|
||||
name: "template_with_3_shards",
|
||||
template: {
|
||||
settings: {
|
||||
"index.number_of_shards": 3,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
|
||||
const response2 = await client.indices.putIndexTemplate({
|
||||
name: "template_1",
|
||||
index_patterns: ["t*"],
|
||||
composed_of: ["template_with_2_shards", "template_with_3_shards"],
|
||||
});
|
||||
console.log(response2);
|
||||
----
|
||||
Reference in New Issue
Block a user