gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

Get no results when using search issues API with keyword which length less than 3

Open Shilongyun opened this issue 3 years ago • 1 comments

I use issues search API to list issues in a project. Search keyword’s length is greater than 2, it works normaly. But when the seach keyword’s length is less than 3, I can’t get any result.

GET /issues?search=fo

Is it a bug in GitLab API?

GitLab version: GitLab 14.4

Shilongyun avatar Mar 09 '22 07:03 Shilongyun

I just checked by calling directly GitLab API and it seems that the search API need at least 3 characters to run the search.

See the following links in your browser:

  • https://gitlab.com/api/v4/projects/4180516/issues?search=ex => no result
  • https://gitlab.com/api/v4/projects/4180516/issues?search=ext => multiple results

I can't find any information in the official documentation: https://docs.gitlab.com/ee/api/issues.html I think the limitation exist to avoid matching too many results. I suggest you to check if there is an issue on GitLab repository about this behaviour. https://gitlab.com/gitlab-org/gitlab/-/issues/

jabby avatar Mar 09 '22 10:03 jabby