Fix performance issue with global search + refactor
What does this MR do?
A performance regression was introduced in !38095 (comment 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.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #249515 (closed)