# Search syntax

Look up search fields, matching options, sorting, and indexing limits.

## Searchable content

Search covers commits reachable from local branches, remote-tracking branches, tags, and the current commit (HEAD), including detached HEAD. Private recovery references are excluded.

Searchable fields include full commit messages, commit and parent hashes, author and committer names and emails, changed-file paths, and old paths for renamed files. Content search includes added, deleted, and context lines from patches.

## Matching options

| Input or option | Behavior |
| --- | --- |
| `login` | Match the substring without case sensitivity. |
| `login timeout` | Match both terms anywhere in the same commit's metadata or changed files. |
| `"login timeout"` | Match the quoted phrase. |
| Match Case | Match letter case. |
| Regular Expression | Interpret the query as a regular expression. |

Repeated literal terms are counted once. Terms can match different files in one commit. A regular-expression search that exceeds its time limit stops with a timeout error.

## Sorting

Relevance is the default and uses BM25 ranking. Newest First sorts by commit date. Short terms, Unicode terms, and regular expressions can require scanning indexed documents. If no term supports relevance ranking, results use Newest First. More results load as you scroll.

## Content and size limits

Patches contain three context lines around changes. They are not complete historical file snapshots. Merge-commit patches compare against the first parent.

Binary patch text is excluded. Patch text is also excluded when either file version exceeds 4 MiB. File paths remain searchable. Search Status displays the exclusion count after indexing completes.

Indexing pauses when the search database and its write-ahead log exceed 2 GiB. Results remain incomplete while indexing is in progress or paused. Check Search Status in the search field's menu. See [Find a change](https://gitlode.com/docs/find-a-change) and [Background fetching and search indexing](https://gitlode.com/docs/background-work).
