diff --git a/pkg/storage/unified/resource/document.go b/pkg/storage/unified/resource/document.go index c43082d69fe..cea910f81c4 100644 --- a/pkg/storage/unified/resource/document.go +++ b/pkg/storage/unified/resource/document.go @@ -166,8 +166,8 @@ func NewIndexableDocument(key *ResourceKey, rv int64, obj utils.GrafanaMetaAcces Key: key, Kind: key.Resource, RV: rv, - Title: title, // We always want *something* to display - TitleSort: title, + Title: title, // We always want *something* to display + TitleSort: strings.ToLower(title), // Lowercase for case-insensitive sorting Labels: obj.GetLabels(), Folder: obj.GetFolder(), CreatedBy: obj.GetCreatedBy(), diff --git a/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json b/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json index 483d9784fa7..9a139b8446a 100644 --- a/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json +++ b/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json @@ -8,7 +8,7 @@ "kind": "dashboards", "rv": 1234, "title": "Test title", - "title_sort": "Test title", + "title_sort": "test title", "description": "test description", "tags": [ "a", diff --git a/pkg/storage/unified/search/testdata/doc/playlist-aaa-out.json b/pkg/storage/unified/search/testdata/doc/playlist-aaa-out.json index 7a920b9390b..de3d5e3ea91 100644 --- a/pkg/storage/unified/search/testdata/doc/playlist-aaa-out.json +++ b/pkg/storage/unified/search/testdata/doc/playlist-aaa-out.json @@ -8,7 +8,7 @@ "kind": "dashboards", "rv": 1234, "title": "Test AAA", - "title_sort": "Test AAA", + "title_sort": "test aaa", "created": 1731336353000, "createdBy": "user:t000000001", "repository": { diff --git a/pkg/storage/unified/search/testdata/doc/report-aaa-out.json b/pkg/storage/unified/search/testdata/doc/report-aaa-out.json index 0cebe848345..e8c6945a1b9 100644 --- a/pkg/storage/unified/search/testdata/doc/report-aaa-out.json +++ b/pkg/storage/unified/search/testdata/doc/report-aaa-out.json @@ -8,7 +8,7 @@ "kind": "dashboards", "rv": 1234, "title": "Test AAA", - "title_sort": "Test AAA", + "title_sort": "test aaa", "created": 1706690655000, "createdBy": "user:abc", "repository": { diff --git a/public/app/features/search/service/unified.ts b/public/app/features/search/service/unified.ts index 560a6382fbc..40f57501b1e 100644 --- a/public/app/features/search/service/unified.ts +++ b/public/app/features/search/service/unified.ts @@ -206,6 +206,10 @@ export class UnifiedSearcher implements GrafanaSearcher { uri += `?query=${encodeURIComponent(query.query ?? '*')}`; uri += `&limit=${query.limit ?? pageSize}`; + if (!isEmpty(query.location)) { + uri += `&folder=${query.location}`; + } + if (query.kind) { // filter resource types uri += '&' + query.kind.map((kind) => `type=${kind}`).join('&');