Support pagination past 10,000 results in Elasticsearch 7
In Elasticsearch 7.x the server only counts the first 10,000 results in the total count by default which means that until we make some changes in GitLab we will not be able to paginate past 10,000 results. It also means that the count will not be accurate on the tab if there were more than 10,000 results.
This change was not addressed in the first MR where Elasticsearch was added in !22859 (merged) . It can be easily handled by sending track_total_hits=true
as a parameter but this is will be less performant and it's also not compatible with older Elasticsearch versions so we'd need to figure out what is the earliest version to support this parameter and handle this accordingly.
It's not clear either if we necessarily care too much to handle this since paginating so many pages is not necessarily valuable and it's also more expensive.
This issue should describe what (if anything) we want to do to address this limitation.'