From 1c9af40f3cc274cfe77e33716501f2c4a0a26f7a Mon Sep 17 00:00:00 2001 From: missinglink Date: Fri, 29 Apr 2016 17:16:44 +0200 Subject: [PATCH] remove query.tokens_complete and query.tokens_incomplete from geoJSON --- middleware/geocodeJSON.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/middleware/geocodeJSON.js b/middleware/geocodeJSON.js index 80d69e86..414d216b 100644 --- a/middleware/geocodeJSON.js +++ b/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);