build: update @openstapps/core version

Adjust code accordingly

Related to #2
This commit is contained in:
Jovan Krunić
2019-07-05 15:14:48 +02:00
committed by Rainer Killinger
parent 3d51ccfac2
commit 992a0a6f2c

View File

@@ -548,20 +548,22 @@ export class Elasticsearch implements Database {
throw new Error('Database is undefined. You have to configure the query build');
}
// check if the database version is defined and in the expected format
if (typeof this.config.internal.database.version === 'undefined'
|| typeof this.config.internal.database.version !== 'string') {
throw new Error('Database version is malformed. Check your config file');
}
// create elasticsearch configuration out of data from database configuration
const esConfig: ElasticsearchConfig = {
name: 'elasticsearch',
name: this.config.internal.database.name as 'elasticsearch',
version: this.config.internal.database.version,
};
if (typeof this.config.internal.database.query !== 'undefined') {
esConfig.query =
this.config.internal.database
.query as ElasticsearchQueryDisMaxConfig | ElasticsearchQueryQueryStringConfig;
esConfig.query =
this.config.internal.database
.query as ElasticsearchQueryDisMaxConfig | ElasticsearchQueryQueryStringConfig;
}
const searchRequest: ES.SearchParams = {