summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-09-22 16:44:19 +0100
committerCorey Hulen <corey@hulen.com>2017-09-22 08:44:19 -0700
commit8bef94d250906851d924c16fc5293bbdae75cb98 (patch)
treefb48df83aee4da900ade0bb61e252a0a5b5b1344 /model
parent7d23276b0cbf4ef5cb45cb20e2dc9f5eb13b3a63 (diff)
downloadchat-8bef94d250906851d924c16fc5293bbdae75cb98.tar.gz
chat-8bef94d250906851d924c16fc5293bbdae75cb98.tar.bz2
chat-8bef94d250906851d924c16fc5293bbdae75cb98.zip
PLT-7694: Allow setting a prefix for Elasticsearch indexes. (#7500)
Diffstat (limited to 'model')
-rw-r--r--model/config.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 64bfc06ce..c55324ea7 100644
--- a/model/config.go
+++ b/model/config.go
@@ -138,6 +138,7 @@ const (
ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_SHARDS = 1
ELASTICSEARCH_SETTINGS_DEFAULT_AGGREGATE_POSTS_AFTER_DAYS = 365
ELASTICSEARCH_SETTINGS_DEFAULT_POSTS_AGGREGATOR_JOB_START_TIME = "03:00"
+ ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX = ""
DATA_RETENTION_SETTINGS_DEFAULT_MESSAGE_RETENTION_DAYS = 365
DATA_RETENTION_SETTINGS_DEFAULT_FILE_RETENTION_DAYS = 365
@@ -482,6 +483,7 @@ type ElasticsearchSettings struct {
PostIndexShards *int
AggregatePostsAfterDays *int
PostsAggregatorJobStartTime *string
+ IndexPrefix *string
}
type DataRetentionSettings struct {
@@ -1569,6 +1571,11 @@ func (o *Config) SetDefaults() {
*o.ElasticsearchSettings.PostsAggregatorJobStartTime = ELASTICSEARCH_SETTINGS_DEFAULT_POSTS_AGGREGATOR_JOB_START_TIME
}
+ if o.ElasticsearchSettings.IndexPrefix == nil {
+ o.ElasticsearchSettings.IndexPrefix = new(string)
+ *o.ElasticsearchSettings.IndexPrefix = ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX
+ }
+
if o.DataRetentionSettings.EnableMessageDeletion == nil {
o.DataRetentionSettings.EnableMessageDeletion = new(bool)
*o.DataRetentionSettings.EnableMessageDeletion = false