Skip to content

Commit 1c5ce62

Browse files
committed
Minor tweaks for ES to OS transition for OpenSearch consolidation
1 parent 97b0671 commit 1c5ce62

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The following parameters can be set in config files or in env variables:
6262
- ES.ES_INDEX: Elasticsearch index name
6363
- ES.ES_REFRESH: Elasticsearch refresh method. Default to string `true`(i.e. refresh immediately)
6464
- FILE_UPLOAD_SIZE_LIMIT: the file upload size limit in bytes
65+
- OPENSEARCH: Flag to use Opensearch NPM instead of Elasticsearch
6566
- RESOURCES_API_URL: TC resources API base URL
6667
- GROUPS_API_URL: TC groups API base URL
6768
- PROJECTS_API_URL: TC projects API base URL

config/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040

4141
ES: {
4242
// above AWS_REGION is used if we use AWS ES
43-
HOST: process.env.ES_HOST || "localhost:9200",
43+
HOST: process.env.OS_HOST || "localhost:9200",
4444
API_VERSION: process.env.ES_API_VERSION || "6.8",
4545
OPENSEARCH: process.env.OPENSEARCH || "false",
4646
ES_INDEX: process.env.ES_INDEX || "challenge",

src/common/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const HttpStatus = require("http-status-codes");
1717
const xss = require("xss");
1818
const logger = require("./logger");
1919

20-
const { Client: ESClient } = require("@opensearch-project/opensearch");
20+
const { Client: OSClient } = require("@opensearch-project/opensearch");
2121
const elasticsearch = require("elasticsearch");
2222

2323
const projectHelper = require("./project-helper");
@@ -734,7 +734,7 @@ function getESClient() {
734734
});
735735
}
736736
} else {
737-
esClient = new ESClient({
737+
esClient = new OSClient({
738738
node: esHost,
739739
ssl: {
740740
rejectUnauthorized: false,

0 commit comments

Comments
 (0)