Index templates allow you to define templates that will automatically be applied when new indices are created (see more in official documentation). Index Templates widely is used to create historically indexes:
Here's example on how to configure index templates:
# app/config/config.yml
fos_elastica:
index_templates:
<name>:
client: default
template_name: <template name>
template: some_index_*
settings:
number_of_shards: 1
number_of_replicas: 0
types:
auto_suggest:
mappings:
<field name>: <params>
...
Index template is similar to index configuration and has the same fields like settings, client, etc. with additional fields:
template_name - template name. If omitted then used key (<name>) of index_templates section. Example: template_1template - template pattern. Example: te* or bar*To apply templates changes, you should run fos:elastica:reset-templates command:
--index - index template name to reset. If no index template name specified than all templates will be reset--force-delete - will delete all indexes that match index templates patterns. Aware that pattern may match various indexes.You must run the following command to sync templates configuration on ES server with YAML configurations:
php bin/console fos:elastica:reset-templates
You can build-in this command into the deployment process to automate template configuration sync.
How can I help you explore Laravel packages today?