diff --git a/package.json b/package.json index af2c5a41..79d64fd1 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "@hapi/joi": "^16.1.8", "colors": "^1.1.2", - "@elastic/elasticsearch": "~7.17.0", + "pelias-elasticsearch": "https://github.com/michaelkirk-pelias/pelias-elasticsearch#mkirk\/elastic8", "glob": "^7.1.6", "lodash": "^4.17.15", "pelias-config": "https://github.com/michaelkirk-pelias/config#mkirk\/elastic8", diff --git a/scripts/check_plugins.js b/scripts/check_plugins.js index ac7a2aa2..8b23db65 100644 --- a/scripts/check_plugins.js +++ b/scripts/check_plugins.js @@ -1,7 +1,7 @@ const colors = require('colors/safe'); const config = require('pelias-config').generate(); -const es = require('@elastic/elasticsearch'); -const client = new es.Client(config.esclient); +const buildClient = require('pelias-elasticsearch'); +const client = buildClient(config.esclient); const cli = require('./cli'); // mandatory plugins diff --git a/scripts/check_version.js b/scripts/check_version.js index 9e0d76b6..77e0894d 100644 --- a/scripts/check_version.js +++ b/scripts/check_version.js @@ -1,8 +1,8 @@ const _ = require('lodash'); const semver = require('semver'); -const es = require('@elastic/elasticsearch'); +const buildClient = require('pelias-elasticsearch'); const config = require('pelias-config').generate(); -const client = new es.Client(config.esclient); +const client = buildClient(config.esclient); const cli = require('./cli'); // pass target elastic version semver as the first CLI arg diff --git a/scripts/create_index.js b/scripts/create_index.js index 93b68b57..9cca702f 100644 --- a/scripts/create_index.js +++ b/scripts/create_index.js @@ -1,6 +1,6 @@ const child_process = require('child_process'); const config = require('pelias-config').generate(); -const es = require('@elastic/elasticsearch'); +const buildClient = require('pelias-elasticsearch'); const SUPPORTED_ES_VERSIONS = '>=7.4.2'; const cli = require('./cli'); @@ -8,7 +8,7 @@ const schema = require('../schema'); cli.header("create index"); -const client = new es.Client(config.esclient); +const client = buildClient(config.esclient); // check minimum elasticsearch versions before continuing try { diff --git a/scripts/drop_index.js b/scripts/drop_index.js index 0c41f56e..91e1547f 100644 --- a/scripts/drop_index.js +++ b/scripts/drop_index.js @@ -1,7 +1,7 @@ const colors = require('colors/safe'); const config = require('pelias-config').generate(); -const es = require('@elastic/elasticsearch'); -const client = new es.Client(config.esclient); +const buildClient = require('pelias-elasticsearch'); +const client = buildClient(config.esclient); const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); diff --git a/scripts/info.js b/scripts/info.js index 62504c6e..26d0788b 100644 --- a/scripts/info.js +++ b/scripts/info.js @@ -1,5 +1,5 @@ var config = require('pelias-config').generate().esclient; -var es = require('@elastic/elasticsearch'); -var client = new es.Client(config); +var buildClient = require('pelias-elasticsearch'); +var client = buildClient(config); client.info( {}, console.log.bind(console) ); diff --git a/scripts/update_settings.js b/scripts/update_settings.js index b2ae69b8..1dbdd633 100644 --- a/scripts/update_settings.js +++ b/scripts/update_settings.js @@ -1,6 +1,6 @@ var config = require('pelias-config').generate(); -var es = require('@elastic/elasticsearch'); -var client = new es.Client(config.esclient); +var buildClient = require('pelias-elasticsearch'); +var client = buildClient(config.esclient); var schema = require('../schema'); var _index = config.schema.indexName; diff --git a/test/elastictest/Suite.js b/test/elastictest/Suite.js index 6a52ba68..8349629a 100644 --- a/test/elastictest/Suite.js +++ b/test/elastictest/Suite.js @@ -1,6 +1,6 @@ const _ = require('lodash') const randomstring = require('randomstring') -const elasticsearch = require('elasticsearch') +const buildClient = require('pelias-elasticsearch'); const async = require('async') function Suite (clientOpts, props) { @@ -26,7 +26,7 @@ Suite.prototype.assert = function (assert) { } Suite.prototype.start = function (cb) { - this.client = new elasticsearch.Client(this.clientOpts) + this.client = buildClient(this.clientOpts) cb() }