Use Advanced search in Projects API with search param
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
Project drop downs across all of GitLab often do not bring back results that users expect. This usually due to
Currently the Projects API supports search with different sort options. The frontend uses the Projects API to allow users to search and select projects from drop downs and uses one of these sorts:
- By similarity
- results are relevant
- All groups/projects the user is authorized for
- Does not include public projects
- By last_activity_at, then id
- results may not be relevant and busy projects float to the top
- All groups and projects the user is authorized for
- Includes public projects
- By created_at, then id (default)
- results are not relevant unless returned set is small
- All groups and projects the user is authorized for
- Includes public projects
This results in the following experiences:
- Project search returns relevant results but they cannot find public projects
- Project search returns public projects but the results are often not relevant (example: search for
gitlab-organd getting back all public forks created recently at the top) - Slow performance on large instances with many projects
- Searching for the exact project name does not return that value at the top
Proposal
All projects are indexed in Advanced search and searchable. If Advanced search is enabled, the API should use that.
The one big issue is that the Projects API offers filters for fields that are not indexed.
It might be possible to use Advanced search with whatever filters are available in Advanced search first to get a large list of project_ids to pass into the ProjectsFinder.
Relevant code:
- The
load_projectsmethod is used for the Projects API inlib/api/projects.rb. - Implementation would need to be in the EE version
ee/lib/ee/api/projects.rb