2.1k sao GitHub và vẫn tăng — sourcegraph/zoekt là dự án Go mà TopGit đang theo dõi trên nền tảng. Fast trigram based code search
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
"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
Install the commands you need with go install, as shown below. The examples
use the latest released version and assume that Go's binary installation
directory is on your PATH.
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@latest
zoekt-git-index -index ~/.zoekt /path/to/repo
Synchronizing local git repos
zoekt-local-sync recursively discovers Git repositories under one or more
roots. Repository names are relative to their root; the command fails before
changing the index if two repositories have the same name. By default the
command previews the repositories that would be removed and indexed; pass -f
to apply the sync. The supplied roots are the complete desired set for the
index directory, so repositories not found beneath them are removed. Use
separate index directories for repository sets that should be managed
independently:
go install github.com/sourcegraph/zoekt/cmd/zoekt-local-sync@latest
go install github.com/sourcegraph/zoekt/cmd/zoekt-git-index@latest
zoekt-local-sync -index ~/.zoekt ~/src
zoekt-local-sync -index ~/.zoekt -f ~/src
The list and remove subcommands inspect and explicitly remove repositories.
Removal, like synchronization, previews by default and requires -f to apply:
go install github.com/sourcegraph/zoekt/cmd/zoekt-index@latest
zoekt-index -index ~/.zoekt /path/to/repo
Searching an index
go install github.com/sourcegraph/zoekt/cmd/zoekt@latest
zoekt 'hello'
zoekt 'hello file:README'
Zoekt services
Zoekt also contains an index server and web server to support larger-scale indexing and searching
of remote repositories. The index server can be configured to periodically fetch and reindex repositories
from a code host. The webserver can be configured to serve search results through a web UI or API.
Indexing a GitHub organization
go install github.com/sourcegraph/zoekt/cmd/zoekt-indexserver@latest
go install github.com/sourcegraph/zoekt/cmd/zoekt-mirror-github@latest
go install github.com/sourcegraph/zoekt/cmd/zoekt-git-index@latest
echo YOUR_GITHUB_TOKEN_HERE > token.txt
echo '[{"GitHubOrg": "apache", "CredentialPath": "token.txt"}]' > config.json
zoekt-indexserver -mirror_config config.json -data_dir ~/.zoekt/
This will fetch all repos under 'github.com/apache', then index the repositories. The indexserver takes care of
periodically fetching and indexing new data, and cleaning up logfiles. See config.go
for more details on this configuration.
Starting the web server
go install github.com/sourcegraph/zoekt/cmd/zoekt-webserver@latest
zoekt-webserver -index ~/.zoekt/
This will start a web server with a simple search UI at http://localhost:6070.
See the query syntax docs for more details on the query
language.
Container image
Zoekt publishes a single container image at ghcr.io/sourcegraph/zoekt. It
includes the Zoekt binaries, git, and universal-ctags. By default it runs
zoekt-webserver against /data/index:
docker run --rm -p 6070:6070 -v "$PWD/index:/data/index" ghcr.io/sourcegraph/zoekt
You can override the default command to run zoekt-indexserver instead. This
example stores cloned repositories, logs, and indexes in the named Docker
volume zoekt-data and reads a mounted mirror config file:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/sourcegraph/zoekt là nguồn chính thức.
sourcegraph/zoekt có bao nhiêu sao?
sourcegraph/zoekt có 2.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/sourcegraph/zoekt. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
sourcegraph/zoekt có những chủ đề gì?
GitHub topics của sourcegraph/zoekt: "repo-type-backend". TopGit xếp repo vào nhóm mã nguồn mở.
sourcegraph/zoekt có phải mã nguồn mở không?
Có — sourcegraph/zoekt phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/sourcegraph/zoekt.
sourcegraph/zoekt có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho sourcegraph/zoekt. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
sourcegraph/zoekt còn đang phát triển không?
Commit gần nhất trên sourcegraph/zoekt là 1 ngày trước (theo timestamp GitHub). Repo có 267 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về zoekt?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về zoekt.