Browse Source

resolves #139

pull/156/head
Peter Johnson 10 years ago
parent
commit
e95c2efb54
  1. 12
      package.json
  2. 2
      query/reverse.js
  3. 14
      test/unit/query/search.js

12
package.json

@ -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",

2
query/reverse.js

@ -9,7 +9,7 @@ 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 } );
query.sort = query.sort.concat( sort( params ) );
if ( params.categories && params.categories.length > 0 ) {

14
test/unit/query/search.js

@ -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
};

Loading…
Cancel
Save