From 8af8ba19f6175ad598b24dcf4d06502c5edb1190 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Wed, 17 Aug 2016 13:11:36 -0400 Subject: [PATCH] added call for fallback sanitiser middleware --- routes/v1.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/v1.js b/routes/v1.js index 6dc0cdbf..833240e9 100644 --- a/routes/v1.js +++ b/routes/v1.js @@ -7,6 +7,7 @@ var sanitisers = { autocomplete: require('../sanitiser/autocomplete'), place: require('../sanitiser/place'), search: require('../sanitiser/search'), + search_fallback: require('../sanitiser/search_fallback'), reverse: require('../sanitiser/reverse'), nearby: require('../sanitiser/nearby') }; @@ -65,8 +66,9 @@ function addRoutes(app, peliasConfig) { middleware.calcSize(), // 2nd parameter is `backend` which gets initialized internally // 3rd parameter is which query module to use, use fallback/geodisambiguation - // first, then use if first query didn't return anything + // first, then use original search strategy if first query didn't return anything controllers.search(peliasConfig, undefined, require('../query/search')), + sanitisers.search_fallback.middleware, controllers.search(peliasConfig, undefined, require('../query/search_original')), postProc.trimByGranularity(), postProc.distances('focus.point.'),