From 2424b0c9e26d5c4b880a7d3ca7d10966059de5eb Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Fri, 23 Jan 2015 14:41:36 -0500 Subject: [PATCH] adding geoname to coarse [experimental] --- helper/queryMixer.json | 4 ++-- sanitiser/coarse.js | 2 +- test/unit/sanitiser/coarse.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helper/queryMixer.json b/helper/queryMixer.json index 4d8ea590..a98dcbaf 100644 --- a/helper/queryMixer.json +++ b/helper/queryMixer.json @@ -27,11 +27,11 @@ ], "coarse": [ { - "layers": ["admin"], + "layers": ["admin", "geoname"], "precision": [5, 3, 1] }, { - "layers": ["admin"], + "layers": ["admin", "geoname"], "precision": [3], "fuzzy": "AUTO" } diff --git a/sanitiser/coarse.js b/sanitiser/coarse.js index da07de7e..d2a14396 100644 --- a/sanitiser/coarse.js +++ b/sanitiser/coarse.js @@ -5,7 +5,7 @@ var logger = require('../src/logger'), input: require('../sanitiser/_input'), size: require('../sanitiser/_size'), layers: function( req ) { - req.query.layers = 'admin'; + req.query.layers = 'admin,geoname'; var layers = require('../sanitiser/_layers'); return layers(req); }, diff --git a/test/unit/sanitiser/coarse.js b/test/unit/sanitiser/coarse.js index f389b423..46e5e54b 100644 --- a/test/unit/sanitiser/coarse.js +++ b/test/unit/sanitiser/coarse.js @@ -2,7 +2,7 @@ var coarse = require('../../../sanitiser/coarse'), _sanitize = coarse.sanitize, middleware = coarse.middleware, - valid_layers = [ 'admin0', 'admin1', 'admin2', 'neighborhood' ], + valid_layers = [ 'geoname', 'admin0', 'admin1', 'admin2', 'neighborhood' ], sanitize = function(query, cb) { _sanitize({'query':query}, cb); }; module.exports.tests = {}; @@ -51,7 +51,7 @@ module.exports.tests.middleware_success = function(test, common) { var defaultClean = { input: 'test', size: 10, - layers: [ 'admin0', 'admin1', 'admin2', 'neighborhood' ], + layers: [ 'geoname', 'admin0', 'admin1', 'admin2', 'neighborhood' ], lat: 0, lon: 0 };