Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search: interpolation results included for layers=-address #1673

Open
missinglink opened this issue Mar 28, 2024 · 0 comments
Open

search: interpolation results included for layers=-address #1673

missinglink opened this issue Mar 28, 2024 · 0 comments
Labels

Comments

@missinglink
Copy link
Member

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.

Screenshot 2024-03-28 at 11 52 04

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:

api/routes/v1.js

Lines 182 to 187 in e6f532b

const interpolationShouldExecute = all(
not(predicates.hasRequestErrors),
isInterpolationEnabled,
predicates.hasParsedTextProperties.all('housenumber', 'street'),
predicates.hasResultsAtLayers('street')
);

Note: this should also improve performance for these queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant