···1111main maintained source of Zoekt. The go module is still
1212`github.com/google/zoekt` for now, but will be updated in the future.
13131414-INSTRUCTIONS
1515-============
1414+# INSTRUCTIONS
16151717-Downloading:
1616+## Downloading
18171918 go get github.com/google/zoekt/
20192121-Indexing:
2020+## Indexing
2121+2222+### Directory
22232324 go install github.com/google/zoekt/cmd/zoekt-index
2425 $GOPATH/bin/zoekt-index .
25262626-Searching
2727-2828- go install github.com/google/zoekt/cmd/zoekt
2929- $GOPATH/bin/zoekt 'ngram f:READ'
3030-3131-Indexing git repositories:
2727+### Git repository
32283329 go install github.com/google/zoekt/cmd/zoekt-git-index
3430 $GOPATH/bin/zoekt-git-index -branches master,stable-1.4 -prefix origin/ .
35313636-Indexing repo repositories:
3232+### Repo repositories
37333834 go install github.com/google/zoekt/cmd/zoekt-{repo-index,mirror-gitiles}
3935 zoekt-mirror-gitiles -dest ~/repos/ https://gfiber.googlesource.com
4036 zoekt-repo-index \
4141- -name gfiber \
4242- -base_url https://gfiber.googlesource.com/ \
4343- -manifest_repo ~/repos/gfiber.googlesource.com/manifests.git \
4444- -repo_cache ~/repos \
4545- -manifest_rev_prefix=refs/heads/ --rev_prefix= \
4646- master:default_unrestricted.xml
3737+ -name gfiber \
3838+ -base_url https://gfiber.googlesource.com/ \
3939+ -manifest_repo ~/repos/gfiber.googlesource.com/manifests.git \
4040+ -repo_cache ~/repos \
4141+ -manifest_rev_prefix=refs/heads/ --rev_prefix= \
4242+ master:default_unrestricted.xml
4343+4444+## Searching
47454848-Starting the web interface
4646+### Web interface
49475048 go install github.com/google/zoekt/cmd/zoekt-webserver
5149 $GOPATH/bin/zoekt-webserver -listen :6070
52505151+### JSON API
5252+5353+You can retrieve search results as JSON by sending a GET request to zoekt-webserver.
5454+5555+ curl --get \
5656+ --url "http://localhost:6070/search" \
5757+ --data-urlencode "q=ngram f:READ" \
5858+ --data-urlencode "num=50" \
5959+ --data-urlencode "format=json"
6060+6161+The response data is a JSON object. You can refer to [web.ApiSearchResult](https://sourcegraph.com/github.com/sourcegraph/zoekt@6b1df4f8a3d7b34f13ba0cafd8e1a9b3fc728cf0/-/blob/web/api.go?L23:6&subtree=true) to learn about the structure of the object.
6262+6363+### CLI
6464+6565+ go install github.com/google/zoekt/cmd/zoekt
6666+ $GOPATH/bin/zoekt 'ngram f:READ'
6767+6868+## Installation
5369A more organized installation on a Linux server should use a systemd unit file,
5470eg.
5571···6480 WantedBy=default.target
658166826767-SEARCH SERVICE
6868-==============
8383+# SEARCH SERVICE
69847085Zoekt comes with a small service management program:
7186···89104as systemd.
90105911069292-SYMBOL SEARCH
9393-=============
107107+# SYMBOL SEARCH
9410895109It is recommended to install [Universal
96110ctags](https://github.com/universal-ctags/ctags) to improve
97111ranking. See [here](doc/ctags.md) for more information.
9811299113100100-ACKNOWLEDGEMENTS
101101-================
114114+# ACKNOWLEDGEMENTS
102115103116Thanks to Han-Wen Nienhuys for creating Zoekt. Thanks to Alexander Neubeck for
104117coming up with this idea, and helping Han-Wen Nienhuys flesh it out.
105118106119107107-FORK DETAILS
108108-==============
120120+# FORK DETAILS
109121110122Originally this fork contained some changes that do not make sense to upstream
111123and or have not yet been upstreamed. However, this is now the defacto source
···134146$ git diff gerrit/master -- ':(exclude)vendor/' ':(exclude)Gopkg*'
135147```
136148137137-DISCLAIMER
138138-==========
149149+# DISCLAIMER
139150140151This is not an official Google product