What does this MR do?
Move clauses from the query stage to the filter stage, when searching notes with elasticsearch, improving search performance and avoiding a hardcoded limit on clause count.
Are there points in the code the reviewer needs to double check?
I don't know how we can test for this without creating 1025 projects in a spec - and that would be too slow :(
Why was this MR needed?
Previous partial fix solved this problem for issues, but not notes: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1282/diffs
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
Changelog entry added, if necessary
All builds are passing
Conform by the merge request performance guides
Conform by the style guides
Branch has no merge conflicts with
master(if it does - rebase it please)
Squashed related commits together
What are the relevant issue numbers?
Closes #1776 (closed)