Search OpenGrok
opengrok_searchSearch indexed source code by full-text, definition, symbol, path, or commit history, combining fields with AND. Returns matching files with line numbers, supports paging and file type filters.
Instructions
Search source code. Provide at least one of full, def, symbol, path, hist; fields combine with AND.
full: full-text Lucene query. Supports wildcards (foo*), phrases ("a b"), AND/OR/NOT (uppercase), fuzzy (word~), regex (/re/).
def: where a symbol is DEFINED. symbol: where a symbol is referenced or defined. Both need language-aware indexing, so they return nothing for file types OpenGrok cannot parse; fall back to full.
path: restrict by file path (e.g. "src/net", "*.cpp").
hist: search commit messages.
type: OpenGrok analyzer name, e.g. c, cxx, java, python, sh, xml, json, yaml, plain. An unknown name yields zero results. Default scope: none (all projects). Results list files with matching lines (line numbers where available).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| def | No | Symbol whose definition to find. | |
| full | No | Full-text query. | |
| hist | No | History/commit message query. | |
| path | No | Path filter. | |
| type | No | File type (analyzer name). | |
| start | No | Offset of the first file to return (default 0); use the value a previous page suggested. | |
| symbol | No | Symbol to find references to. | |
| projects | No | Projects to search (default: none (all projects)). Names from opengrok_list_projects. | |
| max_results | No | Files per page (default 20, max 100). | |
| all_projects | No | Search every project instead of the default. Ignored if projects is set. |