This commit is contained in:
Pieter Vander Vennet 2025-05-29 02:19:37 +02:00
parent a44a04a79d
commit e5be391a00

View file

@ -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