Fixed case insensitive search for file based dashboards, Fixes #2258

This commit is contained in:
Torkel Ödegaard 2015-06-30 08:17:06 +02:00
parent 647e43dcbd
commit d0e7d53c69

View File

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