Skip to content

Revert to using SearchService for user autocomplete

Madelein van Niekerk requested to merge 403325-fix-error-budget into master

What does this MR do and why?

In Enforce a character limit of 2 in autocomplete ... (!117628 - merged), autocomplete for users was changed from using SearchService to native User.search to make it easy to adjust the minimum character for search 2 instead of 3 for basic searches. This means that previously if Elasticsearch was available, it would have been used for users autocomplete but now all scopes use basic search.

After the change went live, we saw a spike in error budget violations (internal link). This is attributed to a chunk of requests going to basic search where it was using advanced search before.

This MR moves back to using SearchService for users autocomplete to move load from postgres to Elasticsearch and decrease the duration of autocomplete calls. This requires changing all basic user searches from a character limit of 3 to 2 by passing use_minimum_char_limit to UsersFinder.

Before After !117628 (merged) This MR
Basic Postgres (min of 3) Postgres (min of 2) Postgres (min of 2)
Advanced Elastic (min of 2) - Elastic (min of 2)

Data

The number of basic searches roughly doubled:

The average duration of basic searches also doubled as a result because of additional postgres queries:

Screenshots

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #403325 (closed)

Edited by Madelein van Niekerk

Merge request reports