mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-11 12:12:55 +00:00
build: update @openstapps/core version
Adjust code accordingly Related to #2
This commit is contained in:
committed by
Rainer Killinger
parent
3d51ccfac2
commit
992a0a6f2c
@@ -548,20 +548,22 @@ export class Elasticsearch implements Database {
|
|||||||
throw new Error('Database is undefined. You have to configure the query build');
|
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'
|
if (typeof this.config.internal.database.version === 'undefined'
|
||||||
|| typeof this.config.internal.database.version !== 'string') {
|
|| typeof this.config.internal.database.version !== 'string') {
|
||||||
throw new Error('Database version is malformed. Check your config file');
|
throw new Error('Database version is malformed. Check your config file');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create elasticsearch configuration out of data from database configuration
|
||||||
const esConfig: ElasticsearchConfig = {
|
const esConfig: ElasticsearchConfig = {
|
||||||
name: 'elasticsearch',
|
name: this.config.internal.database.name as 'elasticsearch',
|
||||||
version: this.config.internal.database.version,
|
version: this.config.internal.database.version,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof this.config.internal.database.query !== 'undefined') {
|
if (typeof this.config.internal.database.query !== 'undefined') {
|
||||||
esConfig.query =
|
esConfig.query =
|
||||||
this.config.internal.database
|
this.config.internal.database
|
||||||
.query as ElasticsearchQueryDisMaxConfig | ElasticsearchQueryQueryStringConfig;
|
.query as ElasticsearchQueryDisMaxConfig | ElasticsearchQueryQueryStringConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchRequest: ES.SearchParams = {
|
const searchRequest: ES.SearchParams = {
|
||||||
|
|||||||
Reference in New Issue
Block a user