Search Interface
The search interface provides a powerful way to explore your codebase using Zoekt query syntax.
Search Bar
Section titled “Search Bar”Basic Search
Section titled “Basic Search”Enter your query in the search bar and press Enter or click Search.
function handleRequestResults appear instantly with matching code highlighted.
Query Syntax
Section titled “Query Syntax”Code Search uses Zoekt query syntax for powerful searching. Here are the most common patterns:
Search in Files or Paths
Section titled “Search in Files or Paths”| Pattern | Description |
|---|---|
foo bar | Both “foo” and “bar” (implicit AND) |
foo or bar | Either “foo” or “bar” |
"exit boot" | Exact phrase match |
FOO case:yes | Case-sensitive search |
/open(File|Dir)/ | Regular expression |
Filter Results
Section titled “Filter Results”| Modifier | Example | Description |
|---|---|---|
file: | file:README setup | Filter by filename |
repo: | repo:torvalds/linux test | Filter by repository |
lang: | lang:typescript | Filter by language |
branch: | branch:main | Filter by branch |
case:yes | FOO case:yes | Case-sensitive search |
case:no | foo case:no | Case-insensitive (default) |
-lang: | foo -lang:c | Negate filter |
-file: | foo -file:test | Exclude files |
-repo: | foo -repo:deprecated | Exclude repository |
Advanced
Section titled “Advanced”| Pattern | Description |
|---|---|
file:\.py$ | Files ending in “.py” |
sym:main | Symbol definitions |
content:README | Search content only (not filenames) |
Combined Queries
Section titled “Combined Queries”repo:myorg/api lang:go func.*Handler -file:testThis searches for:
- Pattern matching
func.*Handler(regex) - In Go files
- In the
myorg/apirepo - Excluding files with “test” in the path
Search Results
Section titled “Search Results”Results List
Section titled “Results List”Each result shows:
- Repository name - The source repository
- File path - Path to the matching file
- Matching lines - Code with syntax highlighting
- Line numbers - For easy reference
Code Preview
Section titled “Code Preview”Click on any result to expand and see more context around the match.
Advanced Features
Section titled “Advanced Features”Regular Expressions
Section titled “Regular Expressions”Use /pattern/ syntax for regex matching:
/func\s+\w+Handler\(/Matches function declarations ending in Handler.
Symbol Search
Section titled “Symbol Search”Search for symbol definitions:
sym:CreateUserFinds definitions (functions, classes, types) named CreateUser.
Search Examples
Section titled “Search Examples”lang:go sym:authFind Go symbol definitions related to authentication.
import "github.com/pkg/errors"Find files importing a specific package.
FOO or BAR or BAZFind all FOO comments.
password or secret or apikey -file:testFind potential secrets (excluding tests).
Keyboard Shortcuts
Section titled “Keyboard Shortcuts”| Shortcut | Action |
|---|---|
/ | Focus search bar |
Escape | Clear search / close preview |
↑ / ↓ | Navigate results |
Enter | Open result |
URL Sharing
Section titled “URL Sharing”The search query is encoded in the URL - share it with teammates:
http://localhost:3000?q=repo:api+lang:go+handlerNext Steps
Section titled “Next Steps”- Connections - Managing code host connections
- Repositories - Repository management