From 2d861aea7ff15090ceccead9ee19e561db2281f6 Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Mon, 2 Mar 2015 19:05:34 -0500 Subject: [PATCH] boosting admin0 values --- query/sort.js | 8 ++++++++ test/unit/query/reverse.js | 7 +++++++ test/unit/query/search.js | 7 +++++++ test/unit/query/sort.js | 7 +++++++ 4 files changed, 29 insertions(+) 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,