From c47959856a033d1a36903199fbd9e60ef88ca4f4 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Wed, 15 Dec 2021 15:29:14 +0200 Subject: [PATCH] Don't use initializer syntax for instantiating client For some reason, the property initializer syntax stopped working. An update to TypeScript? An update to Jest? Unknown, but sticking to the less fancy constructor body to do property init seems to work. Signed-off-by: Charles Lowell --- .../src/engines/ElasticSearchSearchEngine.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts index ca54d46310..48caf0d4f1 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts @@ -72,15 +72,16 @@ function isBlank(str: string) { * @public */ export class ElasticSearchSearchEngine implements SearchEngine { - private readonly elasticSearchClient: Client = this.newClient( - options => new Client(options), - ); + private readonly elasticSearchClient: Client; + constructor( private readonly elasticSearchClientOptions: ElasticSearchClientOptions, private readonly aliasPostfix: string, private readonly indexPrefix: string, private readonly logger: Logger, - ) {} + ) { + this.elasticSearchClient = this.newClient(options => new Client(options)); + } static async fromConfig({ logger,