google / zoekt

Fast trigram based code search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

query the rest api

vpereira opened this issue · comments

Hi,

I was reading the source code and i couldn't figure out how can I query the rest api.

My best try was:

curl -X POST -H "Content-type: application/json; charset=utf-8" -d '{"Query":"printf"}' http://zoekt-server:6070/api/search

However it doesn't work. Could you please provide me an example?

You have to provide a Restrict field too.

The REST API was thought to be used as a mechanism for Gerrit or Gitiles to provide search, by expression project and branch visibility for the logged-in user as a restriction