diff --git a/pkg/services/dashboards/service/dashboard_service.go b/pkg/services/dashboards/service/dashboard_service.go index bc193b82b18..d85fb8ed692 100644 --- a/pkg/services/dashboards/service/dashboard_service.go +++ b/pkg/services/dashboards/service/dashboard_service.go @@ -1702,6 +1702,8 @@ func (dr *DashboardServiceImpl) searchDashboardsThroughK8sRaw(ctx context.Contex if query.Title != "" { // allow wildcard search request.Query = "*" + strings.ToLower(query.Title) + "*" + // if using query, you need to specify the fields you want + request.Fields = dashboardsearch.IncludeFields } if len(query.Tags) > 0 { diff --git a/pkg/services/dashboards/service/search/search.go b/pkg/services/dashboards/service/search/search.go index a10f08954f2..6165dfe0237 100644 --- a/pkg/services/dashboards/service/search/search.go +++ b/pkg/services/dashboards/service/search/search.go @@ -19,6 +19,21 @@ var ( resource.SEARCH_FIELD_FOLDER: "", resource.SEARCH_FIELD_TAGS: "", } + + IncludeFields = []string{ + resource.SEARCH_FIELD_TITLE, + resource.SEARCH_FIELD_TAGS, + resource.SEARCH_FIELD_LABELS, + resource.SEARCH_FIELD_FOLDER, + resource.SEARCH_FIELD_CREATED, + resource.SEARCH_FIELD_CREATED_BY, + resource.SEARCH_FIELD_UPDATED, + resource.SEARCH_FIELD_UPDATED_BY, + resource.SEARCH_FIELD_REPOSITORY_NAME, + resource.SEARCH_FIELD_REPOSITORY_PATH, + resource.SEARCH_FIELD_REPOSITORY_HASH, + resource.SEARCH_FIELD_REPOSITORY_TIME, + } ) func ParseResults(result *resource.ResourceSearchResponse, offset int64) (*v0alpha1.SearchResults, error) { diff --git a/pkg/services/folder/folderimpl/folder_unifiedstorage.go b/pkg/services/folder/folderimpl/folder_unifiedstorage.go index fed599819a1..a1473e7558d 100644 --- a/pkg/services/folder/folderimpl/folder_unifiedstorage.go +++ b/pkg/services/folder/folderimpl/folder_unifiedstorage.go @@ -217,6 +217,8 @@ func (s *Service) searchFoldersFromApiServer(ctx context.Context, query folder.S if query.Title != "" { // allow wildcard search request.Query = "*" + strings.ToLower(query.Title) + "*" + // if using query, you need to specify the fields you want + request.Fields = dashboardsearch.IncludeFields } if query.Limit > 0 {