diff --git a/src/Logic/Web/NameSuggestionIndex.ts b/src/Logic/Web/NameSuggestionIndex.ts index 354b87dbea..0bd828301a 100644 --- a/src/Logic/Web/NameSuggestionIndex.ts +++ b/src/Logic/Web/NameSuggestionIndex.ts @@ -361,7 +361,7 @@ export default class NameSuggestionIndex { return nsi.generateMappings(key, tags, country, center, options) } - private static readonly brandPrefix = ["name", "alt_name", "operator", "brand"] as const + private static readonly brandPrefix = ["name", "alt_name", "operator", "brand", "official_name"] as const /** * An NSI-item might have tags such as `name=X`, `alt_name=brand X`, `brand=X`, `brand:wikidata`, `shop=Y`, `service:abc=yes` @@ -370,6 +370,14 @@ export default class NameSuggestionIndex { * This method is a heuristic which attempts to move all the brand-related tags into an `or` but still requiring the `shop` and other tags * * (More of an extension method on NSIItem) + * + * const item = { + * displayName: "test", + * id: "test", + * locationSet: {include: ["BE"],exclude: []}, + * tags: {name:"XYZ", brand:"XYZ", alt_name: "ABC",official_name:"Association Brusselse Chou"} + * } + * NameSuggestionIndex.asFilterTags(item) // => {or: ["alt_name=ABC", "brand=XYZ","name=XYZ","official_name=Association Brusselse Chou"]} */ static asFilterTags( item: NSIItem