From 07cabd8a32c95042a07d40d53545c3e5070bfe46 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Fri, 9 Mar 2018 18:15:14 -0500 Subject: [PATCH] fix: Avoid querying PIP service for non-coarse reverse Queries that specified only non-corase layers (address or venue) and had no results returned from Elasticsearch would trigger a request to the PIP service. The PIP service does not contain any addresses or venues so this query will never return anything, and only waste time. --- routes/v1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/v1.js b/routes/v1.js index fb3539a8..f4e8176f 100644 --- a/routes/v1.js +++ b/routes/v1.js @@ -138,7 +138,7 @@ function addRoutes(app, peliasConfig) { // fallback to coarse reverse when regular reverse didn't return anything const coarseReverseShouldExecute = all( - isPipServiceEnabled, not(hasRequestErrors), not(hasResponseData) + isPipServiceEnabled, not(hasRequestErrors), not(hasResponseData), not(isOnlyNonAdminLayers) ); const libpostalShouldExecute = all(