mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 05:04:18 +02:00
@@ -157,11 +157,17 @@ func IndexTemplateCreate(conf *cfg.Config, name string, mappings []string) error
|
||||
create := conf.DefaultCluster.ES().Indices.PutIndexTemplate(name)
|
||||
|
||||
if conf.Shards > 0 {
|
||||
settings = settings.NumberOfShards(strconv.Itoa(conf.Shards))
|
||||
settings.NumberOfShards(strconv.Itoa(conf.Shards))
|
||||
}
|
||||
|
||||
if conf.Replicas > 0 {
|
||||
settings = settings.NumberOfReplicas(strconv.Itoa(conf.Replicas))
|
||||
settings.NumberOfReplicas(strconv.Itoa(conf.Replicas))
|
||||
}
|
||||
|
||||
if conf.Policy != "" {
|
||||
settings.Lifecycle(
|
||||
esdsl.NewIndexSettingsLifecycle().
|
||||
Name(conf.Policy))
|
||||
}
|
||||
|
||||
if conf.Stream {
|
||||
@@ -284,6 +290,10 @@ func IndexTemplateModify(conf *cfg.Config, name string, mappings []string) error
|
||||
*settings.Mode = conf.Mode
|
||||
}
|
||||
|
||||
if conf.Policy != "" {
|
||||
settings.Lifecycle.Name = &conf.Policy
|
||||
}
|
||||
|
||||
if len(mappings) > 0 {
|
||||
typemaps, err := modMappings(mappings)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user