feat(BRIDGE-81): kb article suggestion updates + more weight for long keywords.

This commit is contained in:
Xavier Michelon
2024-08-09 15:09:59 +02:00
parent d12928b31c
commit ed1b65731a
3 changed files with 276 additions and 342 deletions

View File

@ -69,7 +69,11 @@ func GetSuggestionsFromArticleList(userInput string, articles ArticleList) (Arti
for _, article := range articles {
for _, keyword := range article.Keywords {
if strings.Contains(userInput, strings.ToUpper(keyword)) {
article.Score++
if len(keyword) > 12 {
article.Score += 2
} else {
article.Score++
}
}
}
}