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
in autocomplete we need this, otherwise queries like "Beijing CN" and "Puerto Escondido MX" fail
in search, we don't need this because for short queries like "Beijing CN", we first
query placeholder which does understand iso2s, and for longer queries with streets, slop should
take care of ignoring the country token
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