Browse Source

added 2nd /search query call for fallback to existing behavior

while we're refining our process for integrating libpostal, the ES querying behavior will be:

- call ES with the fallback/geodisambiguation query
- if there are 0 results, call ES with the existing behavior
pull/666/head
Stephen Hess 8 years ago
parent
commit
45a0755f7d
  1. 4
      routes/v1.js

4
routes/v1.js

@ -63,7 +63,11 @@ function addRoutes(app, peliasConfig) {
search: createRouter([ search: createRouter([
sanitisers.search.middleware, sanitisers.search.middleware,
middleware.calcSize(), 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
controllers.search(peliasConfig, undefined, require('../query/search')), controllers.search(peliasConfig, undefined, require('../query/search')),
controllers.search(peliasConfig, undefined, require('../query/search_original')),
postProc.trimByGranularity(), postProc.trimByGranularity(),
postProc.distances('focus.point.'), postProc.distances('focus.point.'),
postProc.confidenceScores(peliasConfig), postProc.confidenceScores(peliasConfig),

Loading…
Cancel
Save