File tree Expand file tree Collapse file tree 7 files changed +13
-14
lines changed
Expand file tree Collapse file tree 7 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 3030 "dependencies" : {
3131 "@hapi/joi" : " ^16.1.8" ,
3232 "colors" : " ^1.1.2" ,
33- "@elastic/ elasticsearch" : " ~7.17.0 " ,
33+ "pelias- elasticsearch" : " https://github.com/michaelkirk-pelias/pelias-elasticsearch#mkirk \/ elastic8 " ,
3434 "glob" : " ^7.1.6" ,
3535 "lodash" : " ^4.17.15" ,
3636 "pelias-config" : " https://github.com/michaelkirk-pelias/config#mkirk\/ elastic8" ,
Original file line number Diff line number Diff line change 11const colors = require ( 'colors/safe' ) ;
22const config = require ( 'pelias-config' ) . generate ( ) ;
3- const es = require ( '@elastic/ elasticsearch' ) ;
4- const client = new es . Client ( config . esclient ) ;
3+ const buildClient = require ( 'pelias- elasticsearch' ) ;
4+ const client = buildClient ( config . esclient ) ;
55const cli = require ( './cli' ) ;
66
77// mandatory plugins
Original file line number Diff line number Diff line change 11const _ = require ( 'lodash' ) ;
22const semver = require ( 'semver' ) ;
3- const es = require ( '@elastic/ elasticsearch' ) ;
3+ const buildClient = require ( 'pelias- elasticsearch' ) ;
44const config = require ( 'pelias-config' ) . generate ( ) ;
5- const client = new es . Client ( config . esclient ) ;
5+ const client = buildClient ( config . esclient ) ;
66const cli = require ( './cli' ) ;
77
88// pass target elastic version semver as the first CLI arg
Original file line number Diff line number Diff line change 11const child_process = require ( 'child_process' ) ;
22const config = require ( 'pelias-config' ) . generate ( ) ;
3- const es = require ( '@elastic/ elasticsearch' ) ;
3+ const buildClient = require ( 'pelias- elasticsearch' ) ;
44const SUPPORTED_ES_VERSIONS = '>=7.4.2' ;
55
66const cli = require ( './cli' ) ;
77const schema = require ( '../schema' ) ;
88
99cli . header ( "create index" ) ;
1010
11- const client = new es . Client ( config . esclient ) ;
11+ const client = buildClient ( config . esclient ) ;
1212
1313// check minimum elasticsearch versions before continuing
1414try {
Original file line number Diff line number Diff line change 11const colors = require ( 'colors/safe' ) ;
22const config = require ( 'pelias-config' ) . generate ( ) ;
3- const es = require ( '@elastic/ elasticsearch' ) ;
4- const client = new es . Client ( config . esclient ) ;
3+ const buildClient = require ( 'pelias- elasticsearch' ) ;
4+ const client = buildClient ( config . esclient ) ;
55const readline = require ( 'readline' ) ;
66const rl = readline . createInterface ( { input : process . stdin , output : process . stdout } ) ;
77
@@ -20,7 +20,6 @@ function drop() {
2020// check all hosts to see if any is not localhost
2121function warnIfNotLocal ( ) {
2222 for ( const idx in config . esclient . nodes ) {
23- debugger ;
2423 const node = config . esclient . nodes [ idx ] ;
2524 if ( ! node . includes ( '://localhost' ) ) {
2625 console . log ( colors . red ( `WARNING: DROPPING SCHEMA NOT ON LOCALHOST: ${ node } ` ) ) ;
Original file line number Diff line number Diff line change 11var config = require ( 'pelias-config' ) . generate ( ) . esclient ;
2- var es = require ( '@elastic/ elasticsearch' ) ;
3- var client = new es . Client ( config ) ;
2+ var buildClient = require ( 'pelias- elasticsearch' ) ;
3+ var client = buildClient ( config ) ;
44
55client . info ( { } , console . log . bind ( console ) ) ;
Original file line number Diff line number Diff line change 11var config = require ( 'pelias-config' ) . generate ( ) ;
2- var es = require ( '@elastic/ elasticsearch' ) ;
3- var client = new es . Client ( config . esclient ) ;
2+ var buildClient = require ( 'pelias- elasticsearch' ) ;
3+ var client = buildClient ( config . esclient ) ;
44var schema = require ( '../schema' ) ;
55
66var _index = config . schema . indexName ;
You can’t perform that action at this time.
0 commit comments