diff --git a/src/storage/elasticsearch/elasticsearch.ts b/src/storage/elasticsearch/elasticsearch.ts index 1a951d5a..1c4294d1 100644 --- a/src/storage/elasticsearch/elasticsearch.ts +++ b/src/storage/elasticsearch/elasticsearch.ts @@ -205,6 +205,9 @@ export class Elasticsearch implements Database { this.aliasMap = {}; this.ready = false; + checkESTemplate(typeof process.env.ES_FORCE_MAPPING_UPDATE !== 'undefined' ? + process.env.ES_FORCE_MAPPING_UPDATE === 'true' : false); + this.aggregationsSchema = buildAggregations(); this.mailQueue = mailQueue; @@ -484,9 +487,6 @@ export class Elasticsearch implements Database { Monitoring.setUp(monitoringConfiguration, this.client, this.mailQueue); } - checkESTemplate(typeof process.env.ES_FORCE_MAPPING_UPDATE !== 'undefined' ? - process.env.ES_FORCE_MAPPING_UPDATE === 'true' : false); - return this.getAliasMap(); }