commit | b0c18f686b11d13a10f11b4e3e35297f426e9b1a | [log] [tgz] |
---|---|---|
author | Denis Fortin <denis.fortin@adevinta.com> | Tue Mar 24 18:28:55 2020 +0100 |
committer | Denis Fortin <denis.fortin@adevinta.com> | Fri Apr 03 00:59:11 2020 +0200 |
tree | 8b2e0b6d81a2c361abcc123e72afdd297bab383e | |
parent | 30af23a141986fe9f6f773b8d1208b576baa6a89 [diff] |
zoekt-mirror-github: add arguments to filter repos on topics criteria Added `topic` and `exclude_topic` options to the zoekt-mirror-github command. These options are lists. Github repositories are now filtered according to the topics they have. `topic` option will include only the repositories having at least on topic in the list. `exclude_topic` will exclude the repositories having at least one topic in the list. The two options can be combined: `exclude_topic` filter is applied to repositories previously filtered with `topic` Change-Id: I8dceb805cd1aa5455a03c7d3cc425795a614f1f0
"Zoekt, en gij zult spinazie eten" - Jan Eertink ("seek, and ye shall eat spinach" - My primary school teacher)
This is a fast text search engine, intended for use with source code. (Pronunciation: roughly as you would pronounce “zooked” in English)
Downloading:
go get github.com/google/zoekt/
Indexing:
go install github.com/google/zoekt/cmd/zoekt-index $GOPATH/bin/zoekt-index .
Searching
go install github.com/google/zoekt/cmd/zoekt $GOPATH/bin/zoekt 'ngram f:READ'
Indexing git repositories:
go install github.com/google/zoekt/cmd/zoekt-git-index $GOPATH/bin/zoekt-git-index -branches master,stable-1.4 -prefix origin/ .
Indexing repo repositories:
go install github.com/google/zoekt/cmd/zoekt-{repo-index,mirror-gitiles} zoekt-mirror-gitiles -dest ~/repos/ https://gfiber.googlesource.com zoekt-repo-index \ -name gfiber \ -base_url https://gfiber.googlesource.com/ \ -manifest_repo ~/repos/gfiber.googlesource.com/manifests.git \ -repo_cache ~/repos \ -manifest_rev_prefix=refs/heads/ --rev_prefix= \ master:default_unrestricted.xml
Starting the web interface
go install github.com/google/zoekt/cmd/zoekt-webserver $GOPATH/bin/zoekt-webserver -listen :6070
A more organized installation on a Linux server should use a systemd unit file, eg.
[Unit] Description=zoekt webserver [Service] ExecStart=/zoekt/bin/zoekt-webserver -index /zoekt/index -listen :443 --ssl_cert /zoekt/etc/cert.pem --ssl_key /zoekt/etc/key.pem Restart=always [Install] WantedBy=default.target
Zoekt comes with a small service management program:
go install github.com/google/zoekt/cmd/zoekt-indexserver cat << EOF > config.json [{"GithubUser": "username"}, {"GithubOrg": "org"}, {"GitilesURL": "https://gerrit.googlesource.com", "Name": "zoekt" } ] EOF $GOPATH/bin/zoekt-server -mirror_config config.json
This will mirror all repos under ‘github.com/username’, ‘github.com/org’, as well as the ‘zoekt’ repository. It will index the repositories.
It takes care of fetching and indexing new data and cleaning up logfiles.
The webserver can be started from a standard service management framework, such as systemd.
It is recommended to install Universal ctags to improve ranking. See here for more information.
Thanks to Alexander Neubeck for coming up with this idea, and helping me flesh it out.
This is not an official Google product