search_code
Search indexed code repositories using Zoekt queries with filters for repository, file, language, symbol, and regex to find matching code files and snippets.
Instructions
Run a Zoekt query against the indexed corpus.
Query syntax highlights:
- ``repo:NAME`` restrict to repos whose name matches NAME (regex)
- ``file:PATH`` restrict to files whose path matches PATH (regex)
- ``lang:LANGUAGE`` restrict to a language (``python``, ``go``, ...)
- ``sym:IDENT`` match symbol definitions (functions, classes, ...)
- ``case:yes`` case-sensitive content match
- ``/regex/`` regex content match (literal match by default)
- whitespace is AND; use ``or`` for boolean OR
Examples:
- ``lang:python def hello`` — Python files containing ``def hello``
- ``sym:users`` — anything that defines a ``users`` symbol
- ``repo:flask-app file:app.py`` — within one file of one repo
Returns a compact object with ``files`` (each containing ``repo``,
``file``, ``language``, and ``matches``) plus top-level stats.
Results are capped at ``max_results`` files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_results | No | ||
| context_lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||