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,