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