Class SearchApi

All Implemented Interfaces:
Constants

public class SearchApi extends AbstractApi
This class provides an entry point to all the GitLab API Search API calls.
See Also:
  • Constructor Details

    • SearchApi

      public SearchApi(GitLabApi gitLabApi)
  • Method Details

    • globalSearch

      public List<?> globalSearch(Constants.SearchScope scope, String search) throws GitLabApiException
      Search globally across the GitLab instance.
      GitLab Endpoint: POST /search?scope=:scope&search=:search-query
      Parameters:
      scope - search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, snippet_titles, snippet_blobs, users
      search - the search query
      Returns:
      a List containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • globalSearchStream

      public Stream<?> globalSearchStream(Constants.SearchScope scope, String search) throws GitLabApiException
      Search globally across the GitLab instance.
      GitLab Endpoint: POST /search?scope=:scope&search=:search-query
      Parameters:
      scope - search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, snippet_titles, snippet_blobs, users
      search - the search query
      Returns:
      a Stream containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • globalSearch

      public Pager<?> globalSearch(Constants.SearchScope scope, String search, int itemsPerPage) throws GitLabApiException
      Search globally across the GitLab instance.
      GitLab Endpoint: POST /search?scope=:scope&search=:search-query
      Parameters:
      scope - search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, snippet_titles, snippet_blobs, users
      search - the search query
      itemsPerPage - the number of items that will be fetched per page
      Returns:
      a Pager containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • groupSearch

      public List<?> groupSearch(Object groupIdOrPath, Constants.GroupSearchScope scope, String search) throws GitLabApiException
      Search within the specified group. If a user is not a member of a group and the group is private, a request on that group will result to a 404 status code.
      GitLab Endpoint: POST /groups/:groupId/search?scope=:scope&search=:search-query
      Parameters:
      groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
      scope - search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, users
      search - the search query
      Returns:
      a List containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • groupSearchStream

      public Stream<?> groupSearchStream(Object groupIdOrPath, Constants.GroupSearchScope scope, String search) throws GitLabApiException
      Search within the specified group. If a user is not a member of a group and the group is private, a request on that group will result to a 404 status code.
      GitLab Endpoint: POST /groups/:groupId/search?scope=:scope&search=:search-query
      Parameters:
      groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
      scope - search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, users
      search - the search query
      Returns:
      a Stream containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • groupSearch

      public Pager<?> groupSearch(Object groupIdOrPath, Constants.GroupSearchScope scope, String search, int itemsPerPage) throws GitLabApiException
      Search within the specified group. If a user is not a member of a group and the group is private, a request on that group will result to a 404 status code.
      GitLab Endpoint: POST /groups/:groupId/search?scope=:scope&search=:search-query
      Parameters:
      groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
      scope - search the expression within the specified scope. Currently these scopes are supported: projects, issues, merge_requests, milestones, users
      search - the search query
      itemsPerPage - the number of items that will be fetched per page
      Returns:
      a Pager containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • projectSearch

      public List<?> projectSearch(Object projectIdOrPath, Constants.ProjectSearchScope scope, String search) throws GitLabApiException
      Search within the specified project. If a user is not a member of a project and the project is private, a request on that project will result to a 404 status code.
      GitLab Endpoint: POST /projects/:projectId/search?scope=:scope&search=:search-query
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      scope - search the expression within the specified scope. Currently these scopes are supported: issues, merge_requests, milestones, notes, wiki_blobs, commits, blobs, users
      search - the search query
      Returns:
      a List containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • projectSearch

      public List<?> projectSearch(Object projectIdOrPath, Constants.ProjectSearchScope scope, String search, String ref) throws GitLabApiException
      Search within the specified project. If a user is not a member of a project and the project is private, a request on that project will result to a 404 status code.
      GitLab Endpoint: POST /projects/:projectId/search?scope=:scope&search=:search-query&ref=ref
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      scope - search the expression within the specified scope. Currently these scopes are supported: issues, merge_requests, milestones, notes, wiki_blobs, commits, blobs, users
      search - the search query
      ref - the name of a repository branch or tag to search on. The project’s default branch is used by default. This is only applicable for scopes: commits, blobs, and wiki_blobs.
      Returns:
      a List containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • projectSearchStream

      public Stream<?> projectSearchStream(Object projectIdOrPath, Constants.ProjectSearchScope scope, String search) throws GitLabApiException
      Search within the specified project. If a user is not a member of a project and the project is private, a request on that project will result to a 404 status code.
      GitLab Endpoint: POST /projects/:projectId/search?scope=:scope&search=:search-query
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      scope - search the expression within the specified scope. Currently these scopes are supported: issues, merge_requests, milestones, notes, wiki_blobs, commits, blobs, users
      search - the search query
      Returns:
      a Stream containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • projectSearchStream

      public Stream<?> projectSearchStream(Object projectIdOrPath, Constants.ProjectSearchScope scope, String search, String ref) throws GitLabApiException
      Search within the specified project. If a user is not a member of a project and the project is private, a request on that project will result to a 404 status code.
      GitLab Endpoint: POST /projects/:projectId/search?scope=:scope&search=:search-query&ref=ref
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      scope - search the expression within the specified scope. Currently these scopes are supported: issues, merge_requests, milestones, notes, wiki_blobs, commits, blobs, users
      search - the search query
      ref - the name of a repository branch or tag to search on. The project’s default branch is used by default. This is only applicable for scopes: commits, blobs, and wiki_blobs.
      Returns:
      a Stream containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • projectSearch

      public Pager<?> projectSearch(Object projectIdOrPath, Constants.ProjectSearchScope scope, String search, int itemsPerPage) throws GitLabApiException
      Search within the specified project. If a user is not a member of a project and the project is private, a request on that project will result to a 404 status code.
      GitLab Endpoint: POST /project/:projectId/search?scope=:scope&search=:search-query
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      scope - search the expression within the specified scope. Currently these scopes are supported: issues, merge_requests, milestones, notes, wiki_blobs, commits, blobs, users
      search - the search query
      itemsPerPage - the number of items that will be fetched per page
      Returns:
      a Pager containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5
    • projectSearch

      public Pager<?> projectSearch(Object projectIdOrPath, Constants.ProjectSearchScope scope, String search, String ref, int itemsPerPage) throws GitLabApiException
      Search within the specified project. If a user is not a member of a project and the project is private, a request on that project will result to a 404 status code.
      GitLab Endpoint: POST /project/:projectId/search?scope=:scope&search=:search-query&ref=ref
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      scope - search the expression within the specified scope. Currently these scopes are supported: issues, merge_requests, milestones, notes, wiki_blobs, commits, blobs, users
      search - the search query
      ref - the name of a repository branch or tag to search on. The project’s default branch is used by default. This is only applicable for scopes: commits, blobs, and wiki_blobs.
      itemsPerPage - the number of items that will be fetched per page
      Returns:
      a Pager containing the object type specified by the scope
      Throws:
      GitLabApiException - if any exception occurs
      Since:
      GitLab 10.5