diff --git a/query/sort.js b/query/sort.js index 7102651f..5c004deb 100644 --- a/query/sort.js +++ b/query/sort.js @@ -1,7 +1,15 @@ +var admin_boost = 'admin_boost'; var population = 'population'; var weights = require('pelias-suggester-pipeline').weights; module.exports = [ + { + '_script': { + 'file': admin_boost, + 'type': 'number', + 'order': 'desc' + } + }, { '_script': { 'file': population, diff --git a/test/unit/query/reverse.js b/test/unit/query/reverse.js index 26c5e7e9..91f7c2de 100644 --- a/test/unit/query/reverse.js +++ b/test/unit/query/reverse.js @@ -13,6 +13,13 @@ module.exports.tests.interface = function(test, common) { var sort = [ '_score', + { + '_script': { + 'file': 'admin_boost', + 'type': 'number', + 'order': 'desc' + } + }, { '_script': { 'file': 'population', diff --git a/test/unit/query/search.js b/test/unit/query/search.js index 3e9d72f0..6a373bae 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -13,6 +13,13 @@ module.exports.tests.interface = function(test, common) { var sort = [ '_score', + { + '_script': { + 'file': 'admin_boost', + 'type': 'number', + 'order': 'desc' + } + }, { '_script': { 'file': 'population', diff --git a/test/unit/query/sort.js b/test/unit/query/sort.js index ad5f9037..4455744e 100644 --- a/test/unit/query/sort.js +++ b/test/unit/query/sort.js @@ -13,6 +13,13 @@ module.exports.tests.interface = function(test, common) { }; var expected = [ + { + '_script': { + 'file': 'admin_boost', + 'type': 'number', + 'order': 'desc' + } + }, { '_script': { 'file': population,