pelias / api

HTTP API for Pelias Geocoder
http://pelias.io
MIT License
221 stars 162 forks source link

config: enable/disable prefix matching numerals feature via config flag #1596

Closed missinglink closed 2 years ago

missinglink commented 2 years ago

numeral prefix matching was introduced in https://github.com/pelias/api/pull/1514 for the purpose of prefix-matching numeric postalcodes.

we've had a request to optionally disable this functionality, in some installations this behaviour has undesirable effects on custom layers such as a transit stops layer which has numerical stop IDs.

this PR introduces a 'feature flag' which disables that feature via config, but leaves it on by default. I'm somewhat hesitant to introduce many feature flags as they make testing and debugging more difficult.

until such a time as we're able to better handle disabling numeral prefix matching on custom layers this is the really only viable solution.

the following configuration will disable https://github.com/pelias/api/pull/1514 on a per-installation basis:

{
  "api": {
    "feature": {
      "prefix_match_numerals": false
    }
  }
}