pelias / schema

elasticsearch schema files and tooling
MIT License
40 stars 75 forks source link

feat(country_a): country iso2 synonyms #470

Closed blackmad closed 3 years ago

blackmad commented 3 years ago

As an alternative to https://github.com/pelias/schema/pull/469

I don't love some of the complexity here. One other other approach would be to do this in pelias/model, where when a client of pelias model sets the iso3 code, we in the background expand it to send elasticsearch the iso2+iso3 code.

--

This change adds aliases on the existing country_a.ngram field for all iso3 codes where the iso2 code is not a direct prefix of the iso3 code, like MX for MEX

We use a subset so that we can save space in the index, so not every single USA record gets another string on its record