From e5be391a00af2f5c1d1ed6e39f0db43715580f31 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 29 May 2025 02:19:37 +0200 Subject: [PATCH] Add test --- src/Logic/Web/NameSuggestionIndex.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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