Code Search

Full search query syntax.

Introduction

TopicDescription
Intro to Sourcegraph Search TypesNavigating the Code Search web app and the Keyword, Literal, Regex, and Structural search.
Search Results Page OverviewNavigating the search results page.
Intro to Search FiltersAn overview of the most commonly-used search filters such as Language, Repo, and File.
Search TypesSearching against Code, Repo, Path, Symbol, Commit, and Diff data.
Code NavigationFinding defintions and references, and an explanation of precise versus search-based code navigation.
Saving SearchesSaving commonly-used searches.
Search ContextsIntro to Search Contexts and how to manage them.

Advanced Searches

TopicDescription
Non-default branches, revisions, and tagsIntro to Revision search and how to search for specific branches, revisions, and tags.
Commit messagesSearching type:commit messages.
DiffsSearching type:diff .
Added or removed codeCombining type:diff with select:commit.diff.(added OR removed) .
By authorUsing the author: filter.
Time-boxing searchesUsing the before: and after: filters.
Boolean operatorsUsing AND, OR, and NOT operators.
Functions and other symbolsUsing type:symbol filter.
Advanced symbol searchCombining the select:symbol.(symbol_type) and type:symbol filters.
Selecting metadataUsing select: filter to return data other than the type of data searched against, e.g. returning all repos than contain a certain function.
Advanced repo searchUsing repo:has.(...) filters.
Excluding stale reposUsing repo:has.commit.after(...) filter.

Batch Changes and Code Insights

TopicDescription
Batch ChangesIntro to managing Batch Changes and the batch spec file.
Code InsightsIntro to Code Insights.
Code MonitoringIntro to Code Monitoring.
Previous
How to videos
Next
Cody