Browse Source

enabled the fallback if no intersection returned

pull/1058/head
Alex Loyko 7 years ago
parent
commit
b511e072ce
  1. 12
      routes/v1.js

12
routes/v1.js

@ -143,7 +143,8 @@ function addRoutes(app, peliasConfig) {
); );
const libpostalShouldExecute = all( const libpostalShouldExecute = all(
not(isIntersectionLayer), //not(isIntersectionLayer),
not(hasResponseData),
not(hasRequestErrors), not(hasRequestErrors),
not(isRequestSourcesOnlyWhosOnFirst) not(isRequestSourcesOnlyWhosOnFirst)
); );
@ -213,14 +214,14 @@ function addRoutes(app, peliasConfig) {
const shouldDeferToAddressIt = all( const shouldDeferToAddressIt = all(
not(hasRequestErrors), not(hasRequestErrors),
not(hasResponseData), not(hasResponseData),
not(placeholderShouldHaveExecuted), not(placeholderShouldHaveExecuted)
not(isIntersectionLayer) //not(isIntersectionLayer)
); );
// call very old prod query if addressit was the parser // call very old prod query if addressit was the parser
const oldProdQueryShouldExecute = all( const oldProdQueryShouldExecute = all(
not(hasRequestErrors), not(hasRequestErrors),
not(isIntersectionLayer), //not(isIntersectionLayer),
isAddressItParse isAddressItParse
); );
@ -275,6 +276,7 @@ function addRoutes(app, peliasConfig) {
middleware.requestLanguage, middleware.requestLanguage,
middleware.calcSize(), middleware.calcSize(),
controllers.intersection(intersectionParserShouldExecute), controllers.intersection(intersectionParserShouldExecute),
controllers.search(peliasConfig.api, esclient, queries.intersections, intersectionQueryShouldExecute),
controllers.libpostal(libpostalShouldExecute), controllers.libpostal(libpostalShouldExecute),
controllers.placeholder(placeholderService, geometricFiltersApply, placeholderGeodisambiguationShouldExecute), controllers.placeholder(placeholderService, geometricFiltersApply, placeholderGeodisambiguationShouldExecute),
controllers.placeholder(placeholderService, geometricFiltersDontApply, placeholderIdsLookupShouldExecute), controllers.placeholder(placeholderService, geometricFiltersDontApply, placeholderIdsLookupShouldExecute),
@ -284,7 +286,7 @@ function addRoutes(app, peliasConfig) {
controllers.search(peliasConfig.api, esclient, queries.cascading_fallback, fallbackQueryShouldExecute), controllers.search(peliasConfig.api, esclient, queries.cascading_fallback, fallbackQueryShouldExecute),
sanitizers.defer_to_addressit(shouldDeferToAddressIt), sanitizers.defer_to_addressit(shouldDeferToAddressIt),
controllers.search(peliasConfig.api, esclient, queries.very_old_prod, oldProdQueryShouldExecute), controllers.search(peliasConfig.api, esclient, queries.very_old_prod, oldProdQueryShouldExecute),
controllers.search(peliasConfig.api, esclient, queries.intersections, intersectionQueryShouldExecute), //controllers.search(peliasConfig.api, esclient, queries.intersections, intersectionQueryShouldExecute),
postProc.trimByGranularity(), postProc.trimByGranularity(),
postProc.distances('focus.point.'), postProc.distances('focus.point.'),
postProc.confidenceScores(peliasConfig.api), postProc.confidenceScores(peliasConfig.api),

Loading…
Cancel
Save