When interpolations are generated, they are always of type address, however it's possible for the API to return these results even when the layers are specified in a way that excludes the address layer.
For example: https://pelias.github.io/compare/#/v1/search?layers=street&text=10+Brunswick+Street%2C+VIC
In this case the query specifically requested layers=street yet the result set contains rows from the address layer.
The cause of this issue is in the interpolationShouldExecute predicate, which should take into account the requested layers and not execute if the address layer is not targeted:
|
const interpolationShouldExecute = all( |
|
not(predicates.hasRequestErrors), |
|
isInterpolationEnabled, |
|
predicates.hasParsedTextProperties.all('housenumber', 'street'), |
|
predicates.hasResultsAtLayers('street') |
|
); |
Note: this should also improve performance for these queries.
When interpolations are generated, they are always of type
address, however it's possible for the API to return these results even when the layers are specified in a way that excludes theaddresslayer.For example: https://pelias.github.io/compare/#/v1/search?layers=street&text=10+Brunswick+Street%2C+VIC
In this case the query specifically requested
layers=streetyet the result set contains rows from theaddresslayer.The cause of this issue is in the
interpolationShouldExecutepredicate, which should take into account the requested layers and not execute if theaddresslayer is not targeted:api/routes/v1.js
Lines 182 to 187 in e6f532b
Note: this should also improve performance for these queries.