grove
Documentation menu

Search syntax

A Grove query is a list of terms and filters. Terms match file contents and paths; filters such as repo:, file: and lang: narrow where Grove looks and what it returns.

Search results with match counts by language and repository in the sidebarSearch results with match counts by language and repository in the sidebar

Terms

Separate terms with spaces. A file matches when it contains all terms, in any order and on any line.

Query Finds
test server files containing both test and server
"Error 1001" the exact string, space included
"\"Error 1001\"" a string that contains quotes
foo OR bar files containing either term
-deprecated files that do not contain deprecated
open(file|dir) a regular expression (in Regex mode)

Text and Regex mode

The Text / Regex toggle next to the search bar decides how terms are read:

  • Text (the default) matches terms literally. foo.bar( finds exactly that.
  • Regex reads each term as a regular expression (RE2 syntax): \d+, [a-z]+, ^func, Err.*Timeout.

Filters work the same in both modes. In Regex mode, spaces still separate terms, so match a space with \s or put the pattern in quotes, and parentheses group terms rather than characters. The mode is part of the URL (&regex=1), so shared links keep it.

Case

Matching ignores case unless a term contains an uppercase letter: handler finds Handler, HandlerFunc does not find handlerfunc. Add case:yes or case:no to force it either way.

Filters

Prefix most filters with - to exclude instead of include. Filter values are regular expressions unless noted.

Filter Restricts results to
repo: / r: repositories whose name matches, e.g. repo:payments/ for every repository of an org
file: / f: files whose path matches, e.g. file:\.proto$ or file:test
dir: files under a directory, matched literally: dir:internal/auth
lang: a language, e.g. lang:go, lang:typescript
sym: symbol definitions (functions, types, …) whose name matches
content: file contents only, not paths
repohasfile: repositories containing a matching file, e.g. repohasfile:go.mod
archived: archived:yes includes archived repositories, archived:only searches only them
context: a saved search context, e.g. context:frontend
case: case:yes / case:no overrides case handling

Archived repositories are left out unless the query says otherwise. Filters combine with each other and with terms:

lang:go dir:internal -file:_test\.go context.WithCancel
repo:backend repohasfile:go.mod sql.Open

Choosing what results show: select:

select: changes the shape of the results, not what matches.

Value Shows
(none) matching files with their matched lines
select:repo one row per repository that contains a match
select:file the paths of matching files, without lines
select:content matches inside file contents only; path matches are skipped

select:repo log4j answers “which repositories still mention log4j?” at a glance. file: and select:file combine: file:\.go$ select:file handler lists the Go files that mention handler.

select:repo results listing the repositories that contain a matchselect:repo results listing the repositories that contain a match

How many results: count:

A search returns the 100 most relevant files by default. Show more below the results raises the count; count: sets it in the query.

Value Returns
count:500 up to 500 files
count:all as many files as the server allows (5,000)

Every search is capped (5,000 files and 20,000 matched lines by default; see Configuration). When a cap cuts results short, narrow the query or use Download, which has larger limits.

Revisions

Grove indexes each repository’s default branch. To search another branch, tag or commit, add it to the repo: filter with @:

repo:github.com/acme/api@release-2.4 handleRefund
repo:acme/api@9f2c1e7 "retry budget"

The filter has to name a single repository. Revisions that aren’t indexed are searched with git on the fly: this works for any ref the mirror has, but it is slower and results aren’t ranked, and sym: isn’t available.

Commits and diffs

type:commit searches commit messages and type:diff searches the lines commits added or removed. See Commit and diff search.

Downloading results

Download on the results page exports the current query as a file, with larger limits than the page itself (10,000 files and 100,000 matched lines by default). A download cut short by a limit says so in its last line.

Tips

  • Start broad with select:repo, then add repo: to drill into the repositories that matter.
  • dir: is easier than file: when you want everything under a path: no anchors or escaping.
  • Click a language or repository in the results sidebar to add it as a filter.
  • Queries are part of the URL, so a search can be shared as a link.