Browse Source

add 'text' property to /search and /reverse

pull/19/head
Peter Johnson 10 years ago
parent
commit
d52c6077a9
  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.admin1 ){ output.admin1 = doc.admin1; }
if( doc.admin2 ){ output.admin2 = doc.admin2; } if( doc.admin2 ){ output.admin2 = doc.admin2; }
// map suggest output
if( doc.suggest && doc.suggest.output ){
output.text = doc.suggest.output;
}
return output; return output;
// filter-out invalid entries // filter-out invalid entries

2
test/unit/helper/geojsonify.js

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

Loading…
Cancel
Save