diff --git a/helper/admin_weights.js b/helper/admin_weights.js index 76c3d62a..3b53c423 100644 --- a/helper/admin_weights.js +++ b/helper/admin_weights.js @@ -6,7 +6,7 @@ module.exports = { 'admin0': 4, 'admin1': 3, - 'admin2': 1, + 'admin2': 2, 'local_admin': 1, 'locality':1, 'neighborhood':1 diff --git a/query/sort.js b/query/sort.js index d2b40f26..4e24626f 100644 --- a/query/sort.js +++ b/query/sort.js @@ -11,24 +11,24 @@ module.exports = function( params ){ var scriptsConfig = [ { '_script': { - 'params': { - 'weights': admin_weights - }, - 'file': 'weights', + 'file': popularity, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': popularity, + 'file': population, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': population, + 'params': { + 'weights': admin_weights + }, + 'file': 'weights', 'type': 'number', 'order': 'desc' } diff --git a/test/unit/query/reverse.js b/test/unit/query/reverse.js index 52290ce6..eec25ebb 100644 --- a/test/unit/query/reverse.js +++ b/test/unit/query/reverse.js @@ -21,24 +21,24 @@ var sort = [ '_score', { '_script': { - 'params': { - 'weights': admin_weights - }, - 'file': 'weights', + 'file': popularity, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': popularity, + 'file': population, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': population, + 'params': { + 'weights': admin_weights + }, + 'file': 'weights', 'type': 'number', 'order': 'desc' } diff --git a/test/unit/query/search.js b/test/unit/query/search.js index cf149105..879d317e 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -19,26 +19,26 @@ module.exports.tests.interface = function(test, common) { var sort = [ '_score', - { + { '_script': { - 'params': { - 'weights': admin_weights - }, - 'file': 'weights', + 'file': popularity, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': popularity, + 'file': population, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': population, + 'params': { + 'weights': admin_weights + }, + 'file': 'weights', 'type': 'number', 'order': 'desc' } diff --git a/test/unit/query/sort.js b/test/unit/query/sort.js index 48087919..3c17bb26 100644 --- a/test/unit/query/sort.js +++ b/test/unit/query/sort.js @@ -19,31 +19,31 @@ module.exports.tests.interface = function(test, common) { }; var expected = [ - { + { '_script': { - 'params': { - 'weights': admin_weights - }, - 'file': 'weights', + 'file': popularity, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': popularity, + 'file': population, 'type': 'number', 'order': 'desc' } }, { '_script': { - 'file': population, + 'params': { + 'weights': admin_weights + }, + 'file': 'weights', 'type': 'number', 'order': 'desc' } }, - { + { '_script': { 'params': { 'category_weights': category_weights