From d282140999ea9c37f000b808c0d68eecfdbb9acf Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 11 Mar 2021 17:51:09 -0500 Subject: [PATCH] If we match a generic name, stop looking This is for "nextbike" (re: https://github.com/osmlab/name-suggestion-index/issues/4543#issuecomment-796126041) --- modules/services/nsi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/nsi.js b/modules/services/nsi.js index afe223e87..1507d021f 100644 --- a/modules/services/nsi.js +++ b/modules/services/nsi.js @@ -426,7 +426,7 @@ function _upgradeTags(tags, loc) { const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n, loc); // Attempt to match an item in NSI if (!hits || !hits.length) continue; // no match, try next tuple - if (hits[0].match !== 'primary' && hits[0].match !== 'alternate') continue; // a generic match, try next tuple + if (hits[0].match !== 'primary' && hits[0].match !== 'alternate') break; // a generic match, stop looking // A match may contain multiple results, the first one is likely the best one for this location // e.g. `['pfk-a54c14', 'kfc-1ff19c', 'kfc-658eea']`