From f452a027a2318916dcad55d0c1ffaa648afd37fc Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Fri, 17 Oct 2025 09:02:28 +0200 Subject: [PATCH] chore(gallery search): fuzzy with case insentivie (#6490) Signed-off-by: Ettore Di Giacinto --- core/gallery/gallery.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/gallery/gallery.go b/core/gallery/gallery.go index 5986bd46a..82160ece0 100644 --- a/core/gallery/gallery.go +++ b/core/gallery/gallery.go @@ -58,12 +58,12 @@ type GalleryElements[T GalleryElement] []T func (gm GalleryElements[T]) Search(term string) GalleryElements[T] { var filteredModels GalleryElements[T] - + term = strings.ToLower(term) for _, m := range gm { - if fuzzy.Match(term, m.GetName()) || - fuzzy.Match(term, m.GetDescription()) || - fuzzy.Match(term, m.GetGallery().Name) || - strings.Contains(strings.Join(m.GetTags(), ","), term) { + if fuzzy.Match(term, strings.ToLower(m.GetName())) || + fuzzy.Match(term, strings.ToLower(m.GetDescription())) || + fuzzy.Match(term, strings.ToLower(m.GetGallery().Name)) || + strings.Contains(strings.ToLower(strings.Join(m.GetTags(), ",")), term) { filteredModels = append(filteredModels, m) } }