Commit 50ae5cc6 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'vij-snippet-blob-search-api' into 'master'

Remove API references to searching snippet blobs

See merge request gitlab-org/gitlab!29699
parents a600a498 bc02609a
......@@ -17,7 +17,7 @@ GET /search
| `scope` | string | yes | The scope to search in |
| `search` | string | yes | The search query |
Search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, snippet_titles, snippet_blobs, users.
Search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, snippet_titles, users.
If Elasticsearch is enabled additional scopes available are blobs, wiki_blobs and commits. Find more about [the feature](../integration/elasticsearch.md). **(STARTER)**
......@@ -253,39 +253,6 @@ Example response:
]
```
### Scope: snippet_blobs
This scope will be disabled after GitLab 13.0.
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=snippet_blobs&search=test
```
Example response:
```json
[
{
"id": 50,
"title": "Sample file",
"file_name": "file.rb",
"description": "Simple ruby file",
"author": {
"id": 1,
"name": "Administrator",
"username": "root",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
"web_url": "http://localhost:3000/root"
},
"updated_at": "2018-02-06T12:49:29.104Z",
"created_at": "2017-11-28T08:20:18.071Z",
"project_id": 9,
"web_url": "http://localhost:3000/root/jira-test/snippets/50"
}
]
```
### Scope: wiki_blobs **(STARTER)**
This scope is available only if [Elasticsearch](../integration/elasticsearch.md) is enabled.
......
......@@ -5,7 +5,7 @@ module API
module SearchHelpers
def self.global_search_scopes
# This is a separate method so that EE can redefine it.
%w(projects issues merge_requests milestones snippet_titles snippet_blobs users)
%w(projects issues merge_requests milestones snippet_titles users)
end
def self.group_search_scopes
......
......@@ -17,7 +17,6 @@ module API
blobs: Entities::Blob,
wiki_blobs: Entities::Blob,
snippet_titles: Entities::Snippet,
snippet_blobs: Entities::Snippet,
users: Entities::UserBasic
}.freeze
......@@ -36,7 +35,7 @@ module API
end
def snippets?
%w(snippet_blobs snippet_titles).include?(params[:scope]).to_s
%w(snippet_titles).include?(params[:scope]).to_s
end
def entity
......
......@@ -129,16 +129,6 @@ describe API::Search do
it_behaves_like 'response is correct', schema: 'public_api/v4/snippets'
end
context 'for snippet_blobs scope' do
before do
create(:snippet, :public, title: 'awesome snippet', content: 'snippet content')
get api('/search', user), params: { scope: 'snippet_blobs', search: 'content' }
end
it_behaves_like 'response is correct', schema: 'public_api/v4/snippets'
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment