From d0e7d53c691e881601cd1437139636ae294ee3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 30 Jun 2015 08:17:06 +0200 Subject: [PATCH] Fixed case insensitive search for file based dashboards, Fixes #2258 --- pkg/services/search/json_index.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/services/search/json_index.go b/pkg/services/search/json_index.go index a0fc02343e2..e70c662438d 100644 --- a/pkg/services/search/json_index.go +++ b/pkg/services/search/json_index.go @@ -51,13 +51,15 @@ func (index *JsonDashIndex) Search(query *Query) ([]*Hit, error) { return results, nil } + queryStr := strings.ToLower(query.Title) + for _, item := range index.items { if len(results) > query.Limit { break } // add results with matchig title filter - if strings.Contains(item.TitleLower, query.Title) { + if strings.Contains(item.TitleLower, queryStr) { results = append(results, &Hit{ Type: DashHitJson, Title: item.Dashboard.Title,