From ce611fd9337e4f394aec4ce969a7ac4b1697898d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 13 Jul 2015 17:24:36 +0200 Subject: [PATCH] increase search radius to 500km --- query/reverse.js | 7 ++++++- test/unit/query/reverse.js | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/query/reverse.js b/query/reverse.js index 7759864a..fd835e8f 100644 --- a/query/reverse.js +++ b/query/reverse.js @@ -9,7 +9,12 @@ function generate( params ){ lon: params.lon }; - var query = queries.distance( centroid, { size: params.size || 1, sort: true } ); + var query = queries.distance( centroid, { + size: params.size || 1, + sort: true, + distance: '500km' + }); + query.sort = query.sort.concat( sort( params ) ); if ( params.categories && params.categories.length > 0 ) { diff --git a/test/unit/query/reverse.js b/test/unit/query/reverse.js index 7c10f52b..851508bc 100644 --- a/test/unit/query/reverse.js +++ b/test/unit/query/reverse.js @@ -78,7 +78,7 @@ module.exports.tests.query = function(test, common) { 'must': [ { 'geo_distance': { - 'distance': '50km', + 'distance': '500km', 'distance_type': 'plane', 'optimize_bbox': 'indexed', '_cache': true, @@ -139,7 +139,7 @@ module.exports.tests.query = function(test, common) { 'must': [ { 'geo_distance': { - 'distance': '50km', + 'distance': '500km', 'distance_type': 'plane', 'optimize_bbox': 'indexed', '_cache': true,