Zoekt should accept a main query with per-node query overrides
## Problem
If a zoekt query has a very large query, is is duplicative to send the same query to all nodes.
Current payload:
```
{
version: 2,
timeout: "120s",
num_context_lines: 0,
max_file_match_window: 0,
max_file_match_results: 0,
max_line_match_window: 500,
max_line_match_results: 10,
max_line_match_results_per_file: 100,
forward_to: [
{
endpoint: "http://node-a.example.com/", # node1.search_base_url
query: { ... }
},
{
endpoint: "http://node-b.example.com/", # node2.search_base_url
query: { ... } # identical query, different endpoint
}
]
}
```
## Proposal
Instead of sending the exact same query to all nodes, we should support a top level query and per-node query overrides. We should keep support for per-node overrides to keep federated searches flexible and extendable in the future.
Proposed payload:
```
{
version: 2,
timeout: "120s",
num_context_lines: 0,
max_file_match_window: 0,
max_file_match_results: 0,
max_line_match_window: 500,
max_line_match_results: 10,
max_line_match_results_per_file: 100,
query: { ... },
forward_to: [
{
endpoint: "http://node-a.example.com/", # node1.search_base_url
},
{
endpoint: "http://node-b.example.com/", # node2.search_base_url
query: { ... } # node specific query override
}
]
}
```
## References
https://gitlab.com/gitlab-org/gitlab/-/work_items/590935#note_3105927539
issue