Send repoIDs query with AST from rails to zoekt web server

To support complicated queries, Rails should send a AST json structure to zoekt webserver. This query should be functionally equivalent to the existing v1 RepoIds query we do now. This AST should support nested AND/OR logic. This json payload will get converted on zoekt side to a payload that looks like this:

{
  "version": 2,
  "timeout": "30s",
  "num_context_lines": 20,
  "max_file_match_window": 1000,
  "max_file_match_results": 5,
  "max_line_match_window": 500,
  "max_line_match_results": 10,
  "max_line_match_results_per_file": 3,
  "forward_to": [
    {
      "endpoint": "https://api.example.com/search",
      "options": {
        "headers": {
          "Authorization": "Bearer YOUR_ACCESS_TOKEN"
        }
      },
      "query": {
        "and": {
          "children": [
            {
              "repo_ids": [
                12,
                45,
                8
              ]
            },
            {
              "substring": {
                "pattern": "test",
                "case_sensitive": false,
                "content": true
              }
            }
          ]
        }
      }
    }
  ]
}
Edited by John Mason