Skip to content

Fix performance issue with global search + refactor

Dylan Griffith requested to merge 249515-global-search-admin-should-use-any into master

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

Availability and Testing

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)

Edited by Dylan Griffith

Merge request reports