PlatformSearch

Search

Tantivy-powered full-text search with regex, language filtering, and path scoping. Instant results.

Drok search is built on Tantivy — a full-text search engine written in Rust, inspired by Apache Lucene but without the JVM overhead. Every repository is indexed. Every file is searchable. Results are instant.

Search across all repositories you have access to:

drok search "fn refresh_token" --lang rust

Query Syntax

SyntaxDescriptionExample
Plain textFull-text searchrefresh_token
"exact phrase"Exact string match"fn refresh_token"
regex:Regular expressionregex:fn\s+\w+_token
lang:Language filterlang:rust refresh_token
path:Path filterpath:src/auth refresh_token
repo:Repository filterrepo:my-org/my-repo refresh_token
file:Filename filterfile:*.rs refresh_token
NOTExclusionrefresh_token NOT test
ORDisjunctionrefresh_token OR renew_token

Language Filtering

Filter results by programming language. Language detection uses Tree-sitter parsing, not file extension heuristics — a .h file containing Objective-C is correctly identified as Objective-C, not C.

drok search "async fn" --lang rust
drok search "interface Props" --lang typescript
drok search "def __init__" --lang python

Path Scoping

Restrict search to specific directories:

drok search "TODO" --path src/
drok search "import" --path "tests/**/*.py"

Path patterns support glob syntax.

Search Results

Results are displayed with:

  • File path — Full path with repository name
  • Line content — The matching line with syntax highlighting
  • Context lines — Surrounding lines for understanding the match in context
  • Match highlighting — The specific matched text is highlighted within each line
  • Line numbers — Click to navigate directly to the file at that line

Results are ranked by relevance, considering:

  1. Exact match vs. fuzzy match — Exact matches rank higher
  2. File importance — Matches in source files rank above matches in generated or vendored files
  3. Recency — Recently modified files rank higher when relevance is otherwise equal
  4. Match density — Files with multiple matches in proximity rank higher

Instant Results

Search results appear as you type in the web interface. The Tantivy engine returns results in under 50 milliseconds for repositories with millions of lines of code. There is no loading spinner. There is no "Searching..." state that lasts longer than a human can perceive.

Search within a single repository from its page:

  • Press / to open the search bar
  • Results filter to the current repository
  • Use Ctrl+Shift+F / Cmd+Shift+F for cross-repository search

The drok search command mirrors the web search functionality:

# Search across all accessible repos
drok search "pattern"
 
# Search with filters
drok search "pattern" --lang rust --path src/ --repo my-org/my-repo
 
# Regex search
drok search --regex "fn\s+\w+_token" --lang rust
 
# Output formats
drok search "pattern" --format json
drok search "pattern" --format plain

Search Output

my-org/my-repo src/auth/token.rs:42
  fn refresh_token(ttl: Duration) -> Result<Token, AuthError> {
 
my-org/my-repo src/auth/session.rs:118
  let token = refresh_token(Duration::from_secs(3600))?;
 
my-org/other-repo src/lib.rs:7
  pub use auth::refresh_token;

Indexing

Repositories are indexed automatically on every push. The index is incremental — only changed files are re-indexed, not the entire repository. Index updates propagate within seconds of a push completing.

Index Coverage

ContentIndexedNotes
Source code filesYesAll text files under 1 MB
Binary filesNoBy design
Generated filesExcluded by defaultConfigurable via .drok/search-config.yml
Vendored dependenciesExcluded by defaultConfigurable
DocumentationYesMarkdown, reStructuredText, AsciiDoc
Commit messagesYesSearchable via type:commit
Issue contentYesSearchable via type:issue

Search Configuration

Customize indexing behavior per repository:

# .drok/search-config.yml
exclude:
  - "vendor/**"
  - "node_modules/**"
  - "*.generated.*"
  - "dist/**"
include_generated: false
max_file_size: 512KB

API Access

Search is available via the REST API:

curl "https://drok.us/api/v1/search?q=refresh_token&lang=rust" \
  -H "Authorization: Bearer $Drok_TOKEN"

Response:

{
  "total_count": 3,
  "items": [
    {
      "repository": "my-org/my-repo",
      "path": "src/auth/token.rs",
      "line": 42,
      "content": "fn refresh_token(ttl: Duration) -> Result<Token, AuthError> {",
      "context_before": ["/// Refresh an expired token with the given TTL."],
      "context_after": ["    let token = generate_token()?;"],
      "language": "rust"
    }
  ]
}