fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

Add initial docs on /api/search endpoint (#538)

author
Dylan
committer
GitHub
date (Feb 21, 2023, 2:22 PM +0200) commit bc997bac parent 00cd03c5
+27
+27
doc/api.md
··· 1 + # API 2 + 3 + When running `zoekt-webserver` with the `-rpc` option there will be a JSON HTTP API available for searches at `/api/search`: 4 + 5 + ``` 6 + curl -XPOST -d '{"Q":"needle"}' 'http://127.0.0.1:6070/api/search' 7 + ``` 8 + 9 + ## Filtering by repository IDs 10 + 11 + If your projects are indexed with a `repoid` (added automatically by some 12 + indexers) then you can filter your searches to a subset of repositories 13 + efficiently using the `RepoIDs` filter: 14 + 15 + ``` 16 + curl -XPOST -d '{"Q":"needle","RepoIDs":[1234,4567]}' 'http://34.120.239.98/api/search' 17 + ``` 18 + 19 + ## Options 20 + 21 + There are multiple options that can be passed under `Opts` which can also be 22 + found at 23 + [SearchOptions](https://github.com/sourcegraph/zoekt/blob/58cf4748830ac0eded1517cc8c2454694c531fbd/api.go#L470). 24 + 25 + ``` 26 + curl -XPOST -d '{"Q":"needle","Opts":{"EstimateDocCount":true,"NumContextLines":10}}' 'http://34.120.239.98/api/search' 27 + ```