From db1f1c5df97d89b923c4bf91625c41410dc85af4 Mon Sep 17 00:00:00 2001 From: Will Assis <35489495+gassiss@users.noreply.github.com> Date: Thu, 3 Apr 2025 04:02:02 -0300 Subject: [PATCH] search: add manager kind to bleve (#103305) --- pkg/storage/unified/resource/document.go | 5 +++++ pkg/storage/unified/search/bleve.go | 1 + .../unified/search/testdata/manual-dashboard.json | 10 ++++++++++ .../unified/search/testdata/manual-folder.json | 13 +++++++++++-- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pkg/storage/unified/resource/document.go b/pkg/storage/unified/resource/document.go index 39b74532a98..2cb7fe8b398 100644 --- a/pkg/storage/unified/resource/document.go +++ b/pkg/storage/unified/resource/document.go @@ -393,6 +393,11 @@ func StandardSearchFields() SearchableDocumentFields { Type: ResourceTableColumnDefinition_INT64, Description: "Deprecated legacy id of the resource", }, + { + Name: SEARCH_FIELD_MANAGER_KIND, + Type: ResourceTableColumnDefinition_STRING, + Description: "Type of manager, which is responsible for managing the resource", + }, }) if err != nil { panic("failed to initialize standard search fields") diff --git a/pkg/storage/unified/search/bleve.go b/pkg/storage/unified/search/bleve.go index f485ce72e32..17f8fbeba23 100644 --- a/pkg/storage/unified/search/bleve.go +++ b/pkg/storage/unified/search/bleve.go @@ -1080,6 +1080,7 @@ func getAllFields(standard resource.SearchableDocumentFields, custom resource.Se standard.Field(resource.SEARCH_FIELD_RV), standard.Field(resource.SEARCH_FIELD_CREATED), standard.Field(resource.SEARCH_FIELD_LEGACY_ID), + standard.Field(resource.SEARCH_FIELD_MANAGER_KIND), } if custom != nil { diff --git a/pkg/storage/unified/search/testdata/manual-dashboard.json b/pkg/storage/unified/search/testdata/manual-dashboard.json index dbea7a6014e..58620ec3e47 100644 --- a/pkg/storage/unified/search/testdata/manual-dashboard.json +++ b/pkg/storage/unified/search/testdata/manual-dashboard.json @@ -50,6 +50,13 @@ "description": "Deprecated legacy id of the resource", "priority": 0 }, + { + "name": "manager.kind", + "type": "string", + "format": "", + "description": "Type of manager, which is responsible for managing the resource", + "priority": 0 + }, { "name": "schema_version", "type": "number", @@ -189,6 +196,7 @@ null, null, null, + "repo", null, null, null, @@ -229,6 +237,7 @@ null, null, 11, + "repo", null, null, [ @@ -272,6 +281,7 @@ null, null, 10, + "repo", null, null, [ diff --git a/pkg/storage/unified/search/testdata/manual-folder.json b/pkg/storage/unified/search/testdata/manual-folder.json index a2cf62df9eb..9f01be0bddf 100644 --- a/pkg/storage/unified/search/testdata/manual-folder.json +++ b/pkg/storage/unified/search/testdata/manual-folder.json @@ -49,6 +49,13 @@ "format": "int64", "description": "Deprecated legacy id of the resource", "priority": 0 + }, + { + "name": "manager.kind", + "type": "string", + "format": "", + "description": "Type of manager, which is responsible for managing the resource", + "priority": 0 } ], "rows": [ @@ -60,7 +67,8 @@ null, null, null, - 321 + 321, + null ], "object": { "kind": "folders", @@ -80,7 +88,8 @@ null, null, null, - 123 + 123, + "repo" ], "object": { "kind": "folders",