From cd4f109f2896f5e1390904967f818227695ef986 Mon Sep 17 00:00:00 2001 From: Siddharth Dungarwal Date: Wed, 5 Feb 2025 15:59:45 +0530 Subject: [PATCH 1/2] Update documentation for advanced_search --- doc/development/advanced_search.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/development/advanced_search.md b/doc/development/advanced_search.md index 287829c373e3ab..43241671d59813 100644 --- a/doc/development/advanced_search.md +++ b/doc/development/advanced_search.md @@ -392,8 +392,11 @@ New scopes must be added to the following constants: - `search_tab_ability_map` method in `Search::Navigation`. Override in the EE version if needed NOTE: -Global search can be disabled for a scope. Create an ops feature flag named `global_search_SCOPE_tab` that defaults to `true` -and add it to the `global_search_enabled_for_scope?` method in [`SearchService`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/search_service.rb). +Global search can be disabled for a scope. You can do the following changes for disabling global search: + +1. Add an application setting named `global_search_SCOPE_enabled` that defaults to `true` under the `search` column in ApplicationSetting model. +1. Add the setting checkbox in the Admin UI by creating an entry in `global_search_settings_checkboxes` method in [`ApplicationSettingsHelper`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/helpers/application_settings_helper.rb`). +1. Add it to the `global_search_enabled_for_scope?` method in [`SearchService`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/search_service.rb). #### Results classes -- GitLab From af02f56c5af7c81dbaf2c6baafa4c370a58a67c4 Mon Sep 17 00:00:00 2001 From: Siddharth Dungarwal Date: Thu, 6 Feb 2025 15:39:14 +0530 Subject: [PATCH 2/2] Add code links and additional steps --- doc/development/advanced_search.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/development/advanced_search.md b/doc/development/advanced_search.md index 43241671d59813..e38b39b4053e9b 100644 --- a/doc/development/advanced_search.md +++ b/doc/development/advanced_search.md @@ -394,7 +394,8 @@ New scopes must be added to the following constants: NOTE: Global search can be disabled for a scope. You can do the following changes for disabling global search: -1. Add an application setting named `global_search_SCOPE_enabled` that defaults to `true` under the `search` column in ApplicationSetting model. +1. Add an application setting named `global_search_SCOPE_enabled` that defaults to `true` under the `search` jsonb accessor in [`app/models/application_setting.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/application_setting.rb). +1. Add an entry in JSON schema validator file [`app/validators/json_schemas/application_setting_search.json`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/validators/json_schemas/application_setting_search.json) 1. Add the setting checkbox in the Admin UI by creating an entry in `global_search_settings_checkboxes` method in [`ApplicationSettingsHelper`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/helpers/application_settings_helper.rb`). 1. Add it to the `global_search_enabled_for_scope?` method in [`SearchService`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/search_service.rb). -- GitLab