Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 2c643f6

Browse files
authored
Merge branch 'feature/enrich' into enrich
2 parents 76d79f8 + ee74eb6 commit 2c643f6

File tree

4 files changed

+142
-14
lines changed

4 files changed

+142
-14
lines changed

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module.exports = {
3838
ES: {
3939
HOST: process.env.ES_HOST || 'http://localhost:9200',
4040
ES_REFRESH: process.env.ES_REFRESH || 'true',
41+
ES_API_VERSION: process.env.ES_API_VERSION || "7.4",
4142

4243
ELASTICCLOUD: {
4344
id: process.env.ELASTICCLOUD_ID,

package-lock.json

Lines changed: 126 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
"swagger-ui-express": "^4.1.4",
4242
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.4",
4343
"umzug": "^2.3.0",
44+
"aws-sdk": "^2.610.0",
45+
"http-aws-es": "^4.0.0",
46+
"elasticsearch": "^16.1.1",
4447
"winston": "^3.2.1"
4548
},
4649
"devDependencies": {

src/common/es-client.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@ function getESClient () {
2626
}
2727
})
2828
} else {
29-
esClient = new elasticsearch.Client({
30-
node: host
31-
})
29+
if (/.*amazonaws.*/.test(host)) {
30+
esClient = new elasticsearch.Client({
31+
apiVersion: config.get('ES.ES_API_VERSION'),
32+
node: host,
33+
connectionClass: require('http-aws-es'), // eslint-disable-line global-require
34+
});
35+
console.log('esClient=> ', esClient)
36+
} else {
37+
esClient = new elasticsearch.Client({
38+
node: host
39+
})
40+
}
3241
}
3342
return esClient
3443
}

0 commit comments

Comments
 (0)