Skip to content
代码片段 群组 项目
未验证 提交 be99e0c5 编辑于 作者: Dmitry Gruzd's avatar Dmitry Gruzd 提交者: GitLab
浏览文件

Merge branch '434899-fix-search_type-reporting-for-blobs-api-search-in-zoekt' into 'master'

Use search_service to determine type

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139537



Merged-by: default avatarDmitry Gruzd <dgruzd@gitlab.com>
Approved-by: default avatarRavi Kumar <rkumar@gitlab.com>
Approved-by: default avatarDmitry Gruzd <dgruzd@gitlab.com>
Co-authored-by: default avatarTerri Chu <tchu@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -26,11 +26,6 @@ def verify_search_scope!(resource:)
def use_elasticsearch?(resource)
::Gitlab::CurrentSettings.search_using_elasticsearch?(scope: resource)
end
override :search_type
def search_type(additional_params = {})
search_service(additional_params).use_elasticsearch? ? 'advanced' : super
end
end
end
end
......
......@@ -459,6 +459,30 @@ def results_paths
it_behaves_like 'elasticsearch enabled', level: :group
end
end
context 'when zoekt is enabled', :zoekt do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
zoekt_ensure_project_indexed!(project)
end
it 'sets group search information for logging' do
expect(Gitlab::Instrumentation::GlobalSearchApi).to receive(:set_information).with(
type: 'zoekt',
level: 'group',
scope: 'blobs',
search_duration_s: a_kind_of(Numeric)
)
get api(endpoint, user), params: { scope: 'blobs', search: 'folder' }
end
it_behaves_like 'response is correct', schema: 'public_api/v4/blobs', size: 3 do
before do
get api(endpoint, user), params: { scope: 'blobs', search: 'file:README' }
end
end
end
end
end
......
......@@ -119,7 +119,7 @@ def verify_search_scope!(resource:)
end
def search_type(additional_params = {})
'basic'
search_service(additional_params).search_type
end
def search_scope
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册