Description Usage Arguments References Examples
Index templates allow you to define templates that will automatically be applied when new indices are created
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
conn |
an Elasticsearch connection object, see |
name |
(character) The name of the template |
body |
(character/list) The template definition |
create |
(logical) Whether the index template should only be added
if new or can also replace an existing one. Default: |
flat_settings |
(logical) Return settings in flat format.
Default: |
master_timeout |
(integer) Specify timeout for connection to master |
order |
(integer) The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) |
timeout |
(integer) Explicit operation timeout |
... |
Curl options. Or in |
filter_path |
(character) a regex for filtering output path, see example |
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ## Not run:
(x <- connect())
body <- '{
"template": "te*",
"settings": {
"number_of_shards": 1
},
"mappings": {
"type1": {
"_source": {
"enabled": false
},
"properties": {
"host_name": {
"type": "keyword"
},
"created_at": {
"type": "date",
"format": "EEE MMM dd HH:mm:ss Z YYYY"
}
}
}
}
}'
index_template_put(x, "template_1", body = body)
# get templates
index_template_get(x)
index_template_get(x, "template_1")
index_template_get(x, c("template_1", "template_2"))
index_template_get(x, "template_*")
## filter path
index_template_get(x, "template_1", filter_path = "*.template")
# template exists
index_template_exists(x, "template_1")
index_template_exists(x, "foobar")
# delete a template
index_template_delete(x, "template_1")
index_template_exists(x, "template_1")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.