{"id":13490994,"url":"https://github.com/sourcegraph/zoekt","last_synced_at":"2025-03-28T07:31:43.163Z","repository":{"id":37470229,"uuid":"151158582","full_name":"sourcegraph/zoekt","owner":"sourcegraph","description":"Fast trigram based code search  ","archived":false,"fork":false,"pushed_at":"2025-03-25T16:34:04.000Z","size":15451,"stargazers_count":877,"open_issues_count":21,"forks_count":114,"subscribers_count":58,"default_branch":"main","last_synced_at":"2025-03-28T02:48:26.010Z","etag":null,"topics":["repo-type-backend"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcegraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-01T20:58:06.000Z","updated_at":"2025-03-27T21:47:39.000Z","dependencies_parsed_at":"2024-03-18T23:29:17.381Z","dependency_job_id":"6fbf9aa6-eb56-49a8-bac8-d7bfc4273e06","html_url":"https://github.com/sourcegraph/zoekt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fzoekt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fzoekt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fzoekt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcegraph%2Fzoekt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcegraph","download_url":"https://codeload.github.com/sourcegraph/zoekt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245989202,"owners_count":20705780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["repo-type-backend"],"created_at":"2024-07-31T19:00:52.676Z","updated_at":"2025-03-28T07:31:43.157Z","avatar_url":"https://github.com/sourcegraph.png","language":"Go","readme":"# Zoekt: fast code search\n\n    \"Zoekt, en gij zult spinazie eten\" - Jan Eertink\n\n    (\"seek, and ye shall eat spinach\" - My primary school teacher)\n\nZoekt is a text search engine intended for use with source\ncode. (Pronunciation: roughly as you would pronounce \"zooked\" in English)\n\n**Note:** This has been the maintained source for Zoekt since 2017, when it was forked from the\noriginal repository [github.com/google/zoekt](https://github.com/google/zoekt).\n\n## Background\n\nZoekt supports fast substring and regexp matching on source code, with a rich query language\nthat includes boolean operators (and, or, not). It can search individual repositories, and search\nacross many repositories in a large codebase. Zoekt ranks search results using a combination of code-related signals\nlike whether the match is on a symbol. Because of its general design based on trigram indexing and syntactic\nparsing, it works well for a variety of programming languages.\n\nThe two main ways to use the project are\n* Through individual commands, to index repositories and perform searches through Zoekt's [query language](doc/query_syntax.md)\n* Or, through the indexserver and webserver, which support syncing repositories from a code host and searching them through a web UI or API\n\nFor more details on Zoekt's design, see the [docs directory](doc/).\n\n## Usage\n\n### Installation\n\n    go get github.com/sourcegraph/zoekt/\n\n**Note**: It is also recommended to install [Universal ctags](https://github.com/universal-ctags/ctags), as symbol\ninformation is a key signal in ranking search results. See [ctags.md](doc/ctags.md) for more information.\n\n### Command-based usage\n\nZoekt supports indexing and searching repositories on the command line. This is most helpful\nfor simple local usage, or for testing and development.\n\n#### Indexing a local git repo\n\n    go install github.com/sourcegraph/zoekt/cmd/zoekt-git-index\n    $GOPATH/bin/zoekt-git-index -index ~/.zoekt /path/to/repo\n\n#### Indexing a local directory (not git-specific)\n\n    go install github.com/sourcegraph/zoekt/cmd/zoekt-index\n    $GOPATH/bin/zoekt-index -index ~/.zoekt /path/to/repo\n\n#### Searching an index\n\n    go install github.com/sourcegraph/zoekt/cmd/zoekt\n    $GOPATH/bin/zoekt 'hello'\n    $GOPATH/bin/zoekt 'hello file:README'\n\n### Zoekt services\n\nZoekt also contains an index server and web server to support larger-scale indexing and searching\nof remote repositories. The index server can be configured to periodically fetch and reindex repositories\nfrom a code host. The webserver can be configured to serve search results through a web UI or API.\n\n#### Indexing a GitHub organization\n    \n    go install github.com/sourcegraph/zoekt/cmd/zoekt-indexserver\n\n    echo YOUR_GITHUB_TOKEN_HERE \u003e token.txt\n    echo '[{\"GitHubOrg\": \"apache\", \"CredentialPath\": \"token.txt\"}]' \u003e config.json\n\n    $GOPATH/bin/zoekt-indexserver -mirror_config config.json -data_dir ~/.zoekt/ \n\nThis will fetch all repos under 'github.com/apache', then index the repositories. The indexserver takes care of\nperiodically fetching and indexing new data, and cleaning up logfiles. See [config.go](cmd/zoekt-indexserver/config.go)\nfor more details on this configuration.\n\n#### Starting the web server\n\n    go install github.com/sourcegraph/zoekt/cmd/zoekt-webserver\n    $GOPATH/bin/zoekt-webserver -index ~/.zoekt/\n\nThis will start a web server with a simple search UI at http://localhost:6070. See the [uuery syntax docs](doc/query_syntax.md)\nfor more details on the query language.\n\nIf you start the web server with `-rpc`, it exposes a [simple JSON search API](doc/json-api.md) at `http://localhost:6070/search/api/search.\n\nFinally, the web server exposes a gRPC API that supports [structured query objects](query/query.go) and advanced search options.\n\n## Acknowledgements\n\nThanks to Han-Wen Nienhuys for creating Zoekt. Thanks to Alexander Neubeck for\ncoming up with this idea, and helping Han-Wen Nienhuys flesh it out.\n","funding_links":[],"categories":["开源类库","Go","Database Drivers","Open source library","Data Integration Frameworks","数据库驱动程序"],"sub_categories":["文本处理","Search and Analytic Databases","Word Processing","检索及分析资料库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcegraph%2Fzoekt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcegraph%2Fzoekt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcegraph%2Fzoekt/lists"}