• Dylan Griffith's avatar
    Fix performance issue with global search + refactor · 9b58848a
    Dylan Griffith authored
    A performance regression was introduced in
    https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38095#note_412661217
    . This reverts the relevant code that was necessarily passing through a
    limited set of project IDs for Elasticsearch.
    
    This also takes an extra refactoring step. Since we are passing project
    IDs through to this method it no longer has the projects which was
    necessary for the `#generic_search_results` method. But this was only
    ever used for user search because users are not indexed in Elasticsearch
    and as such cannot actually search using Elasticsearch. I decided it
    kept things simpler to move this logic further up the calling stack so
    we don't need the `Elastic::SearchResults` objects to be delegating back
    again to the normal `SearchResults` objects. This is much simpler
    because the calling code is already responsible for determining whether
    or not Elasticsearch should be used anyway.
    9b58848a
search_results_spec.rb 41 KB