Fast trigram based code search

https://news.ycombinator.com/rss Hits: 9
Summary

Zoekt: fast code search "Zoekt, en gij zult spinazie eten" - Jan Eertink ("seek, and ye shall eat spinach" - My primary school teacher) Zoekt is a text search engine intended for use with source code. (Pronunciation: roughly as you would pronounce "zooked" in English) Note: This has been the maintained source for Zoekt since 2017, when it was forked from the original repository github.com/google/zoekt. Background Zoekt supports fast substring and regexp matching on source code, with a rich query language that includes boolean operators (and, or, not). It can search individual repositories, and search across many repositories in a large codebase. Zoekt ranks search results using a combination of code-related signals like whether the match is on a symbol. Because of its general design based on trigram indexing and syntactic parsing, it works well for a variety of programming languages. The two main ways to use the project are Through individual commands, to index repositories and perform searches through Zoekt's query language Or, through the indexserver and webserver, which support syncing repositories from a code host and searching them through a web UI or API For more details on Zoekt's design, see the docs directory. Usage Installation go get github.com/sourcegraph/zoekt/ Note: It is also recommended to install Universal ctags, as symbol information is a key signal in ranking search results. See ctags.md for more information. Command-based usage Zoekt supports indexing and searching repositories on the command line. This is most helpful for simple local usage, or for testing and development. Indexing a local git repo go install github.com/sourcegraph/zoekt/cmd/zoekt-git-index $GOPATH/bin/zoekt-git-index -index ~/.zoekt /path/to/repo Indexing a local directory (not git-specific) go install github.com/sourcegraph/zoekt/cmd/zoekt-index $GOPATH/bin/zoekt-index -index ~/.zoekt /path/to/repo Searching an index go install github.com/sourcegraph/zoekt/cmd/zoekt $GOPATH/bi...

First seen: 2025-12-05 05:15

Last seen: 2025-12-05 13:16