From 49d439425e2ab6cc65476f86df0f56e27aeeaf94 Mon Sep 17 00:00:00 2001 From: Diana Shkolnikov Date: Thu, 13 Aug 2015 12:05:21 -0400 Subject: [PATCH] Use address_weights.js in tests instead of hardcoding boost values --- test/unit/query/search.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/unit/query/search.js b/test/unit/query/search.js index 0413706e..ed3d1a6d 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -7,8 +7,10 @@ var category = 'category'; var parser = require('../../../helper/query_parser'); var category_weights = require('../../../helper/category_weights'); var admin_weights = require('../../../helper/admin_weights'); +var address_weights = require('../../../helper/address_weights'); var weights = require('pelias-suggester-pipeline').weights; + module.exports.tests = {}; module.exports.tests.interface = function(test, common) { @@ -269,7 +271,7 @@ module.exports.tests.query = function(test, common) { 'match': { 'address.number': { 'query': 123, - 'boost': 1 + 'boost': address_weights.number } } }, @@ -277,7 +279,7 @@ module.exports.tests.query = function(test, common) { 'match': { 'address.street': { 'query': 'main st', - 'boost': 3 + 'boost': address_weights.street } } }, @@ -285,7 +287,7 @@ module.exports.tests.query = function(test, common) { 'match': { 'address.zip': { 'query': 10010, - 'boost': 3 + 'boost': address_weights.zip } } }, @@ -293,7 +295,7 @@ module.exports.tests.query = function(test, common) { 'match': { 'admin1_abbr': { 'query': 'NY', - 'boost': 3 + 'boost': address_weights.admin1_abbr } } }, @@ -301,7 +303,7 @@ module.exports.tests.query = function(test, common) { 'match': { 'alpha3': { 'query': 'USA', - 'boost': 5 + 'boost': address_weights.alpha3 } } }, @@ -623,7 +625,7 @@ module.exports.tests.query = function(test, common) { match: { 'address.number': { 'query': 1, - 'boost': 1 + 'boost': address_weights.number } } }, @@ -631,7 +633,7 @@ module.exports.tests.query = function(test, common) { match: { 'address.street': { 'query': 'water st', - 'boost': 3 + 'boost': address_weights.street } } }, @@ -639,7 +641,7 @@ module.exports.tests.query = function(test, common) { 'match': { 'admin1_abbr': { 'query': 'NY', - 'boost': 3 + 'boost': address_weights.admin1_abbr } } },