diff --git a/integration/analyzer_peliasHousenumber.js b/integration/analyzer_peliasHousenumber.js index 1e341fe3..860c123a 100644 --- a/integration/analyzer_peliasHousenumber.js +++ b/integration/analyzer_peliasHousenumber.js @@ -57,7 +57,9 @@ function analyze( suite, t, analyzer, comment, text, expected ){ analyzer: analyzer, text: text }, function( err, res ){ - if( err ) console.error( err ); + if( err ) { + console.error( err ); + } t.deepEqual( simpleTokens( res.tokens ), expected, comment ); done(); }); diff --git a/integration/analyzer_peliasIndexOneEdgeGram.js b/integration/analyzer_peliasIndexOneEdgeGram.js index da46111e..ba61d6c9 100644 --- a/integration/analyzer_peliasIndexOneEdgeGram.js +++ b/integration/analyzer_peliasIndexOneEdgeGram.js @@ -171,17 +171,17 @@ module.exports.tests.unicode = function(test, common){ // Chambéry (both forms appear the same) var composed = "Chamb" + latin_small_letter_e_with_acute + "ry"; - var decomposed = "Chamb" + combining_acute_accent + latin_small_letter_e + "ry" + var decomposed = "Chamb" + combining_acute_accent + latin_small_letter_e + "ry"; assertAnalysis( 'composed', composed, ['c', 'ch', 'cha', 'cham', 'chamb', 'chambe', 'chamber', 'chambery'] ); assertAnalysis( 'decomposed', decomposed, ['c', 'ch', 'cha', 'cham', 'chamb', 'chambe', 'chamber', 'chambery'] ); // Één (both forms appear the same) - var composed = latin_large_letter_e_with_acute + latin_small_letter_e_with_acute + "n"; - var decomposed = combining_acute_accent + latin_large_letter_e + combining_acute_accent + latin_small_letter_e + "n" + var composed2 = latin_large_letter_e_with_acute + latin_small_letter_e_with_acute + "n"; + var decomposed2 = combining_acute_accent + latin_large_letter_e + combining_acute_accent + latin_small_letter_e + "n"; - assertAnalysis( 'composed', composed, ['e','ee','een'] ); - assertAnalysis( 'decomposed', decomposed, ['e','ee','een'] ); + assertAnalysis( 'composed', composed2, ['e','ee','een'] ); + assertAnalysis( 'decomposed', decomposed2, ['e','ee','een'] ); suite.run( t.end ); }); @@ -205,7 +205,9 @@ function analyze( suite, t, analyzer, comment, text, expected ){ analyzer: analyzer, text: text }, function( err, res ){ - if( err ) console.error( err ); + if( err ) { + console.error( err ); + } t.deepEqual( simpleTokens( res.tokens ), expected, comment ); done(); }); diff --git a/integration/analyzer_peliasPhrase.js b/integration/analyzer_peliasPhrase.js index 63cd8bde..35e90039 100644 --- a/integration/analyzer_peliasPhrase.js +++ b/integration/analyzer_peliasPhrase.js @@ -300,17 +300,17 @@ module.exports.tests.unicode = function(test, common){ // Chambéry (both forms appear the same) var composed = "Chamb" + latin_small_letter_e_with_acute + "ry"; - var decomposed = "Chamb" + combining_acute_accent + latin_small_letter_e + "ry" + var decomposed = "Chamb" + combining_acute_accent + latin_small_letter_e + "ry"; assertAnalysis( 'composed', composed, ['chambery'] ); assertAnalysis( 'decomposed', decomposed, ['chambery'] ); // Één (both forms appear the same) - var composed = latin_large_letter_e_with_acute + latin_small_letter_e_with_acute + "n"; - var decomposed = combining_acute_accent + latin_large_letter_e + combining_acute_accent + latin_small_letter_e + "n" + var composed2 = latin_large_letter_e_with_acute + latin_small_letter_e_with_acute + "n"; + var decomposed2 = combining_acute_accent + latin_large_letter_e + combining_acute_accent + latin_small_letter_e + "n"; - assertAnalysis( 'composed', composed, ['een'] ); - assertAnalysis( 'decomposed', decomposed, ['een'] ); + assertAnalysis( 'composed', composed2, ['een'] ); + assertAnalysis( 'decomposed', decomposed2, ['een'] ); suite.run( t.end ); }); diff --git a/integration/analyzer_peliasQueryFullToken.js b/integration/analyzer_peliasQueryFullToken.js index be7984a6..9ac0a12f 100644 --- a/integration/analyzer_peliasQueryFullToken.js +++ b/integration/analyzer_peliasQueryFullToken.js @@ -214,17 +214,17 @@ module.exports.tests.unicode = function(test, common){ // Chambéry (both forms appear the same) var composed = "Chamb" + latin_small_letter_e_with_acute + "ry"; - var decomposed = "Chamb" + combining_acute_accent + latin_small_letter_e + "ry" + var decomposed = "Chamb" + combining_acute_accent + latin_small_letter_e + "ry"; assertAnalysis( 'composed', composed, ['chambery'] ); assertAnalysis( 'decomposed', decomposed, ['chambery'] ); // Één (both forms appear the same) - var composed = latin_large_letter_e_with_acute + latin_small_letter_e_with_acute + "n"; - var decomposed = combining_acute_accent + latin_large_letter_e + combining_acute_accent + latin_small_letter_e + "n" + var composed2 = latin_large_letter_e_with_acute + latin_small_letter_e_with_acute + "n"; + var decomposed2 = combining_acute_accent + latin_large_letter_e + combining_acute_accent + latin_small_letter_e + "n" - assertAnalysis( 'composed', composed, ['een'] ); - assertAnalysis( 'decomposed', decomposed, ['een'] ); + assertAnalysis( 'composed', composed2, ['een'] ); + assertAnalysis( 'decomposed', decomposed2, ['een'] ); suite.run( t.end ); }); @@ -248,7 +248,9 @@ function analyze( suite, t, analyzer, comment, text, expected ){ analyzer: analyzer, text: text }, function( err, res ){ - if( err ) console.error( err ); + if ( err ) { + console.error( err ); + } t.deepEqual( simpleTokens( res.tokens ), expected, comment ); done(); }); diff --git a/scripts/check_plugins.js b/scripts/check_plugins.js index bacb5de5..05180936 100644 --- a/scripts/check_plugins.js +++ b/scripts/check_plugins.js @@ -45,7 +45,7 @@ client.nodes.info( null, function( err, res ){ // bool, is the plugin currently installed? var isInstalled = !!node.plugins.filter( function( installedPlugin ){ - return installedPlugin.name == plugin; + return installedPlugin.name === plugin; }).length; // output status to terminal @@ -74,7 +74,7 @@ client.nodes.info( null, function( err, res ){ }); }); console.error( "\n\033[1;37mnote:\033[0m some plugins may require you to restart elasticsearch.\n"); - process.exit(1) + process.exit(1); } console.log(); diff --git a/scripts/cli.js b/scripts/cli.js index 086f10b7..a2016cf2 100644 --- a/scripts/cli.js +++ b/scripts/cli.js @@ -4,4 +4,4 @@ var util = require('util'); module.exports.header = function( text ){ var rule = new Array( text.length + 3 ).join("-"); console.log( util.format("\n\033[0;33m%s\n %s \n%s\033[0m\n", rule, text, rule ) ); -} +}; diff --git a/scripts/drop_index.js b/scripts/drop_index.js index b0dbd75b..2b88777d 100644 --- a/scripts/drop_index.js +++ b/scripts/drop_index.js @@ -7,8 +7,11 @@ var readline = require('readline'), schema = require('../schema'); // use -f or --force-yes to skip the prompt -if( isForced() ) drop(); -else prompt( drop, fail ); +if( isForced() ) { + drop(); +} else { + prompt( drop, fail ); +} function drop(){ client.indices.delete( { index: config.schema.indexName }, function( err, res ){ @@ -28,7 +31,9 @@ function warnIfNotLocal() { function prompt( yes, no ){ warnIfNotLocal(); rl.question( 'Are you sure you want to drop the ' + config.schema.indexName + ' index and delete ALL records? ', function( answer ){ - if( !answer.match(/^y(es)?$/i) ) return no(); + if( !answer.match(/^y(es)?$/i) ) { + return no(); + } return yes(); }); } diff --git a/test/document.js b/test/document.js index 99d8489d..423fbba9 100644 --- a/test/document.js +++ b/test/document.js @@ -126,12 +126,12 @@ module.exports.tests.parent_analysis = function(test, common) { }); test('postalcode', function(t) { - t.equal(prop['postalcode'].type, 'string'); - t.equal(prop['postalcode'].analyzer, 'peliasZip'); - t.equal(prop['postalcode'+'_a'].type, 'string'); - t.equal(prop['postalcode'+'_a'].analyzer, 'peliasZip'); - t.equal(prop['postalcode'+'_id'].type, 'string'); - t.equal(prop['postalcode'+'_id'].index, 'not_analyzed'); + t.equal(prop.postalcode.type, 'string'); + t.equal(prop.postalcode.analyzer, 'peliasZip'); + t.equal(prop.postalcode_a.type, 'string'); + t.equal(prop.postalcode_a.analyzer, 'peliasZip'); + t.equal(prop.postalcode_id.type, 'string'); + t.equal(prop.postalcode_id.index, 'not_analyzed'); t.end(); }); diff --git a/test/settings.js b/test/settings.js index c223a77a..eb763812 100644 --- a/test/settings.js +++ b/test/settings.js @@ -413,17 +413,17 @@ module.exports.tests.overrides = function(test, common) { test('override defaults', function(t) { var s = settings(); - t.equal(s.index['number_of_replicas'], '0', 'unchanged'); + t.equal(s.index.number_of_replicas, '0', 'unchanged'); // set the PELIAS_CONFIG env var - process.env['PELIAS_CONFIG'] = path.resolve( __dirname + '/fixtures/config.json' ); + process.env.PELIAS_CONFIG = path.resolve( __dirname + '/fixtures/config.json' ); s = settings(); - t.equal(s.index['number_of_replicas'], '999', 'changed'); + t.equal(s.index.number_of_replicas, '999', 'changed'); t.end(); // unset the PELIAS_CONFIG env var - delete process.env['PELIAS_CONFIG']; + delete process.env.PELIAS_CONFIG; }); };