Browse Source

added call for fallback sanitiser middleware

pull/666/head
Stephen Hess 8 years ago
parent
commit
8af8ba19f6
  1. 4
      routes/v1.js

4
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.'),

Loading…
Cancel
Save