Browse Source

remove query.tokens_complete and query.tokens_incomplete from geoJSON

pull/526/head
missinglink 9 years ago
parent
commit
1c9af40f3c
  1. 6
      middleware/geocodeJSON.js

6
middleware/geocodeJSON.js

@ -16,7 +16,7 @@ function setup(peliasConfig, basePath) {
config: peliasConfig || require('pelias-config').generate().api,
basePath: basePath || '/'
};
function middleware(req, res, next) {
return convertToGeocodeJSON(req, res, next, opts);
}
@ -56,6 +56,10 @@ function convertToGeocodeJSON(req, res, next, opts) {
// Helpful for debugging and understanding how the input impacts results.
res.body.geocoding.query = req.clean;
// remove arrays produced by the tokenizer (only intended to be used internally).
delete res.body.geocoding.query.tokens_complete;
delete res.body.geocoding.query.tokens_incomplete;
// OPTIONAL. Warnings and errors.
addMessages(req, 'warnings', res.body.geocoding);
addMessages(req, 'errors', res.body.geocoding);

Loading…
Cancel
Save