Skip to content

Search API

Dojo provides fast full-text search across all files in a repository. Search indexes are built automatically and maintained incrementally on every push.

GET /api/repos/{owner}/{name}/search

Query parameters:

ParameterRequiredDefaultDescription
qSearch query
refmainBranch/bookmark to search
limit50Max results
pathFilter results to paths containing this string

Example:

Terminal window
curl "https://dojo.ninja/api/repos/mies/dojo/search?q=handleAuth&ref=main" \
-H "Authorization: Bearer $TOKEN"

Response:

{
"query": "handleAuth",
"results": [
{
"path": "src/auth.ts",
"snippet": "...export function >>>>handleAuth<<<<(req: Request) {...",
"rank": -3.5
},
{
"path": "src/middleware.ts",
"snippet": "...const result = await >>>>handleAuth<<<<(c.req)...",
"rank": -1.2
}
]
}

Results are ranked by relevance. Snippets use >>>> and <<<< markers to highlight matching terms.

Search includes both committed files and the workspace overlay (uncommitted changes):

GET /api/repos/{owner}/{name}/workspaces/{wsId}/search

Query parameters:

ParameterRequiredDefaultDescription
qSearch query
limit50Max results
pathPath filter

Response includes a source field:

{
"query": "handleAuth",
"results": [
{
"path": "src/auth.ts",
"snippet": "...function >>>>handleAuth<<<<(req: Request)...",
"rank": -3.5,
"source": "base"
},
{
"path": "src/new-middleware.ts",
"snippet": "...await >>>>handleAuth<<<<(c.req)...",
"source": "overlay"
}
]
}
  • "base" — match is from the committed files
  • "overlay" — match is from an uncommitted workspace file
QueryDescription
error handlingMatch documents containing both words
"error handling"Match exact phrase
error OR warningMatch either word
error NOT testMatch “error” but not “test”
auth*Prefix matching
NEAR(error handler, 5)Words within 5 tokens of each other
  • All text files under 512KB
  • UTF-8 encoded content

Excluded from indexing:

  • Binary files (images, fonts, archives, compiled files)
  • Generated/vendored paths (node_modules/, vendor/, dist/)
  • Minified files (*.min.*)
  • Lock files (*.lock)
  • On push — only changed files are re-indexed (incremental)
  • On workspace commit — index updated for the new commit
  • On first search — built automatically if no index exists yet