Browse Source

Merge pull request #19 from pelias/geojsonify_all_the_things

add 'text' property to /search and /reverse
pull/20/head
Peter Johnson @insertcoffee 10 years ago
parent
commit
8b7d1c08e5
  1. 5
      helper/geojsonify.js
  2. 2
      test/unit/helper/geojsonify.js

5
helper/geojsonify.js

@ -73,6 +73,11 @@ function search( docs ){
if( doc.admin1 ){ output.admin1 = doc.admin1; }
if( doc.admin2 ){ output.admin2 = doc.admin2; }
// map suggest output
if( doc.suggest && doc.suggest.output ){
output.text = doc.suggest.output;
}
return output;
// filter-out invalid entries

2
test/unit/helper/geojsonify.js

@ -140,6 +140,7 @@ module.exports.tests.search = function(test, common) {
]
},
"properties": {
"text": "'Round Midnight Jazz and Blues Bar, Angel, United Kingdom",
"name": "'Round Midnight Jazz and Blues Bar",
"admin0": "United Kingdom",
"admin1": "Islington",
@ -156,6 +157,7 @@ module.exports.tests.search = function(test, common) {
]
},
"properties": {
"text": "Blues Cafe, Smithfield, United Kingdom",
"name": "Blues Cafe",
"admin0": "United Kingdom",
"admin1": "City And County Of The City Of London",

Loading…
Cancel
Save