diff --git a/config/default.json b/config/default.json index fd3e81baa5..f4eec7ec56 100644 --- a/config/default.json +++ b/config/default.json @@ -316,7 +316,8 @@ "PostIndexShards": 1, "AggregatePostsAfterDays": 365, "PostsAggregatorJobStartTime": "03:00", - "IndexPrefix": "" + "IndexPrefix": "", + "LiveIndexingBatchSize": 1 }, "DataRetentionSettings": { "EnableMessageDeletion": false, diff --git a/i18n/en.json b/i18n/en.json index 4c09b8ebae..50073765fb 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -3691,6 +3691,14 @@ "id": "ent.data_retention.generic.license.error", "translation": "License does not support Data Retention." }, + { + "id": "ent.elasticsearch.start.create_bulk_processor_failed.app_error", + "translation": "Failed to create Elasticsearch bulk processor" + }, + { + "id": "ent.elasticsearch.start.start_bulk_processor_failed.app_error", + "translation": "Failed to start Elasticsearch bulk processor" + }, { "id": "ent.elasticsearch.aggregator_worker.create_index_job.error", "translation": "Elasticsearch aggregator worker failed to create the indexing job" @@ -4407,6 +4415,10 @@ "id": "model.config.is_valid.elastic_search.username.app_error", "translation": "Elastic Search Username setting must be provided when Elastic Search indexing is enabled." }, + { + "id": "model.config.is_valid.elastic_search.live_indexing_batch_size.app_error", + "translation": "Elasticsearch Live Indexing Batch Size must be at least 1" + }, { "id": "model.config.is_valid.email_batching_buffer_size.app_error", "translation": "Invalid email batching buffer size for email settings. Must be zero or a positive number." diff --git a/model/config.go b/model/config.go index 7becddff46..80d982e5e0 100644 --- a/model/config.go +++ b/model/config.go @@ -140,6 +140,7 @@ const ( ELASTICSEARCH_SETTINGS_DEFAULT_AGGREGATE_POSTS_AFTER_DAYS = 365 ELASTICSEARCH_SETTINGS_DEFAULT_POSTS_AGGREGATOR_JOB_START_TIME = "03:00" ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX = "" + ELASTICSEARCH_SETTINGS_DEFAULT_LIVE_INDEXING_BATCH_SIZE = 1 DATA_RETENTION_SETTINGS_DEFAULT_MESSAGE_RETENTION_DAYS = 365 DATA_RETENTION_SETTINGS_DEFAULT_FILE_RETENTION_DAYS = 365 @@ -487,6 +488,7 @@ type ElasticsearchSettings struct { AggregatePostsAfterDays *int PostsAggregatorJobStartTime *string IndexPrefix *string + LiveIndexingBatchSize *int } type DataRetentionSettings struct { @@ -1584,6 +1586,11 @@ func (o *Config) SetDefaults() { *o.ElasticsearchSettings.IndexPrefix = ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX } + if o.ElasticsearchSettings.LiveIndexingBatchSize == nil { + o.ElasticsearchSettings.LiveIndexingBatchSize = new(int) + *o.ElasticsearchSettings.LiveIndexingBatchSize = ELASTICSEARCH_SETTINGS_DEFAULT_LIVE_INDEXING_BATCH_SIZE + } + if o.DataRetentionSettings.EnableMessageDeletion == nil { o.DataRetentionSettings.EnableMessageDeletion = new(bool) *o.DataRetentionSettings.EnableMessageDeletion = false @@ -1969,6 +1976,10 @@ func (ess *ElasticsearchSettings) isValid() *AppError { return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.posts_aggregator_job_start_time.app_error", nil, err.Error(), http.StatusBadRequest) } + if *ess.LiveIndexingBatchSize < 1 { + return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.live_indexing_batch_size.app_error", nil, "", http.StatusBadRequest) + } + return nil }