Skip to content

Commit 30bdb1c

Browse files
committed
Merge pull request github#349 from github/search-updates
Update Search API documentation on search qualifiers
2 parents 3ea2406 + b9338dd commit 30bdb1c

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

content/changes/2013-10-18-new-code-search-requirements.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ The value must include [at least one user, organization, or repository][search-b
1818

1919
For example, with this query, we're searching for code from [@twitter][] or [@facebook][] that uses an MIT License:
2020

21-
MIT License @twitter @facebook
21+
MIT License user:twitter user:facebook
2222

2323
And here, we're looking for uses of the underscore library in [@mozilla's BrowserQuest][@mozilla/BrowserQuest] repository:
2424

25-
underscore language:js @mozilla/BrowserQuest
25+
underscore language:js repo:mozilla/BrowserQuest
2626

2727
To perform these queries via the API, we would use the following URLs (respectively):
2828

29-
https://api.github.com/search/code?q=MIT+License+%40twitter+%40facebook
29+
https://api.github.com/search/code?q=MIT+License+user%3Atwitter+user%3Afacebook
3030

31-
https://api.github.com/search/code?q=underscore+language%3Ajs+%40mozilla%2FBrowserQuest
31+
https://api.github.com/search/code?q=underscore+language%3Ajs+repo%3Amozilla%2FBrowserQuest
3232

3333
All the various [code search qualifiers][code-search-qualifiers] are still available to you.
3434
A [user, organization, or repository qualifier][search-by-user-org-repo] is now required.

content/v3/search.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ Suppose you want to find the definition of the `addClass` function inside
145145
[jQuery](https://github.com/jquery/jquery). Your query would look something like
146146
this:
147147

148-
https://api.github.com/search/code?q=addClass+in:file+language:js+@jquery/jquery
148+
https://api.github.com/search/code?q=addClass+in:file+language:js+repo:jquery/jquery
149149

150150
Here, we're searching for the keyword `addClass` within a file's contents. We're
151151
making sure that we're only looking in files where the language is JavaScript.
152-
And we're scoping the search to the `@jquery/jquery` repository.
152+
And we're scoping the search to the `repo:jquery/jquery` repository.
153153

154154
<%= headers 200 %>
155155
<%= json(:code_search_v3_results) %>
@@ -163,7 +163,7 @@ media type in your Accept header. For example, via curl, the above query would
163163
look like this:
164164

165165
curl -H 'Accept: application/vnd.github.v3.text-match+json' \
166-
https://api.github.com/search/code?q=addClass+in:file+language:js+@jquery/jquery
166+
https://api.github.com/search/code?q=addClass+in:file+language:js+repo:jquery/jquery
167167

168168
This produces the same JSON payload as above, with an extra key called
169169
`text_matches`, an array of objects. These objects provide information such as
@@ -198,6 +198,11 @@ q
198198
Finds issues that are assigned to a certain user.
199199
* [Mentions](https://help.github.com/articles/searching-issues#mentions)
200200
Finds issues that mention a certain user.
201+
* [Commenter](https://help.github.com/articles/searching-issues#commenter)
202+
Finds issues that a certain user commented on.
203+
* [Involves](https://help.github.com/articles/searching-issues#involves)
204+
Finds issues that were either created by a certain user, assigned to that
205+
user, mention that user, or were commented on by that user.
201206
* [State](https://help.github.com/articles/searching-issues#state)
202207
Filter issues based on whether they're open or closed.
203208
* [Labels](https://help.github.com/articles/searching-issues#labels)

0 commit comments

Comments
 (0)