Saved searches
Saved searches let you save and describe search queries so you can easily find and use them again later. You can create a saved search for anything, including diffs and commits across all branches of your repositories.
If you want Sourcegraph to monitor a search query and send notifications when there are new results, use code monitoring.
Creating saved searches
A saved search consists of a description and a query, both of which you can define and edit.
Saved searches can be associated with a user or an org:
- User saved searches are only visible to (and editable by) the user that created them.
- Org saved searches are visible to (and editable by) all members of the org.
User saved searches
To create a User saved search:
- Go to User menu > Saved searches in the top navigation bar.
- Press the + Add new search button.
- In the Query field, type in the components of the search query.
- In the Description field, type in a human-readable description for your saved search.
- Click Create. The saved search is created, and you can see the number of results.
Alternatively, to create a saved search from a search you've already run:
- Execute a search from the homepage or navigation bar.
- Press the Save this search query button that appears on the right side of the screen above the first result.
- Follow the instructions from above to fill in the remaining fields.
To view User saved searches, go to User menu > Saved searches in the top navigation bar.
Org saved searches
To create an Org saved search:
- Go to User menu and click the desired organization under Your organizations
- Click the Saved Searches tab
- Press the + Add new search button.
- In the Query field, type in the components of the search query.
- In the Description field, type in a human-readable description for your saved search.
- Click Create. The saved search is created, and you can see the number of results.
Org saved searches are viewable in the Saved Searches tab of the organization's page.
Example saved searches
See the search examples page for a useful list of searches to save.