Skip to content

Commit

Permalink
Merge pull request #156 from pelias/issue_139
Browse files Browse the repository at this point in the history
Issue 139
  • Loading branch information
missinglink committed Jul 13, 2015
2 parents 42a2c18 + ce611fd commit 8e0892b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@
"express": "^4.8.8",
"geojson": "^0.2.1",
"geojson-extent": "^0.3.1",
"geopipes-elasticsearch-backend": "0.0.12",
"geopipes-elasticsearch-backend": "^0.2.0",
"is-object": "^1.0.1",
"markdown": "0.5.0",
"pelias-esclient": "0.0.25",
"pelias-logger": "^0.0.8",
"through2": "0.6.5",
"microtime": "1.4.0",
"morgan": "1.5.2",
"pelias-config": "^0.1.4",
"microtime": "1.4.0",
"pelias-suggester-pipeline": "2.0.2"
"pelias-esclient": "0.0.25",
"pelias-logger": "^0.0.8",
"pelias-suggester-pipeline": "2.0.2",
"through2": "0.6.5"
},
"devDependencies": {
"ciao": "^0.3.4",
Expand Down
7 changes: 6 additions & 1 deletion query/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ function generate( params ){
lon: params.lon
};

var query = queries.distance( centroid, { size: params.size || 1 } );
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 ) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/query/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 1 addition & 13 deletions test/unit/query/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,7 @@ module.exports.tests.query = function(test, common) {
}
}
},
'sort': [
'_score',
{
'_geo_distance': {
'center_point': {
'lat': 29.49136,
'lon': -82.50622
},
'order': 'asc',
'unit': 'km'
}
}
].concat(sort.slice(1)),
'sort': ['_score'].concat(sort.slice(1)),
'size': 10,
'track_scores': true
};
Expand Down

0 comments on commit 8e0892b

Please sign in to comment.