2018-07-18 16:03:33 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-08-29 19:22:45 +00:00
|
|
|
module Search
|
2019-10-17 12:07:33 +00:00
|
|
|
class SnippetService < Search::GlobalService
|
2014-08-29 19:22:45 +00:00
|
|
|
def execute
|
2019-09-30 15:08:09 +00:00
|
|
|
Gitlab::SnippetSearchResults.new(current_user, params[:search])
|
2014-08-29 19:22:45 +00:00
|
|
|
end
|
2017-03-31 13:03:55 +00:00
|
|
|
|
|
|
|
def scope
|
|
|
|
@scope ||= %w[snippet_titles].delete(params[:scope]) { 'snippet_blobs' }
|
|
|
|
end
|
2014-08-29 19:22:45 +00:00
|
|
|
end
|
|
|
|
end
|
2019-09-13 13:26:31 +00:00
|
|
|
|
|
|
|
Search::SnippetService.prepend_if_ee('::EE::Search::SnippetService')
|