Skip to content

Add min char limitation to search autocomplete backend

Background

Search autocomplete endpoint does not enforce min character limit like /search endpoint

There are three types of autocomplete data returned when a user types into the search bar:

  1. generic results
    • results for Settings and Help
    • these are hardcoded
  2. recently viewed items
    • epics, issues, merge requests
    • these use Redis
  3. resources
    • groups, projects, users, issues
    • these use a mix of Database and Elasticsearch

Proposal

Enforce the min character limit for resources autocomplete data since that hits the database and Elasticsearch. The search_autocomplete_opts method has three filter types (search, generic, and default) which return a variety of data.

Edited by Terri Chu