Browse Source

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.
pull/1095/head
Julian Simioni 7 years ago
parent
commit
07cabd8a32
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 2
      routes/v1.js

2
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(

Loading…
Cancel
Save