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:

  1. Go to User menu > Saved searches in the top navigation bar.
  2. Press the + Add new search button.
  3. In the Query field, type in the components of the search query.
  4. In the Description field, type in a human-readable description for your saved search.
  5. 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:

  1. Execute a search from the homepage or navigation bar.
  2. Press the Save this search query button that appears on the right side of the screen above the first result.
  3. 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:

  1. Go to User menu and click the desired organization under Your organizations
  2. Click the Saved Searches tab
  3. Press the + Add new search button.
  4. In the Query field, type in the components of the search query.
  5. In the Description field, type in a human-readable description for your saved search.
  6. 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.