Search contrib and core code
search_codeSearch the source of every indexed contrib project, plus core, for a code pattern: which files, or with by_repo which projects. Who-uses-a-core-symbol counts: list_symbol_users or lookup_core_symbol.
query is a regex. Set literal for exact text with ( [ ] . $ : or a space, and put r: f: lang: case: sym: b: terms in filters. repos: project machine name list. The index runs RE2, which has no lookaround or backreferences.
.module, .install, .theme, .engine, .profile and .inc count as PHP: lang:php includes them and sym: resolves inside them. No language filter is applied for you.
Returns total_matches and total_files plus a head of files (repo, path, matching lines), limit ≤ 50. by_repo: (repo, file_count) rows from a pull of up to 1000 files; total_files is the ceiling; truncated when cut. A parse error returns the index's own message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Files to return, default 20, cap 50. Ignored with by_repo. | |
| query | Yes | Code to find, a regex unless literal is true. Filters may be inline when literal is false, else in filters. Example: hook_form_alter f:\.module$ | |
| repos | No | Restrict to these projects, by machine name, in one query. | |
| by_repo | No | Return repos as (repo, file_count) instead of files. Pulls up to 1000 files; total_files is the ceiling. | |
| filters | No | Zoekt filters appended as written: r:<repo regex> f:<path regex> lang:<language> b:<branch> sym:<symbol> case:yes. | |
| literal | No | true: query is matched as exact text. Use it for text with ( [ ] $ . such as #[Hook(. With literal, filters go in filters. |