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:
    Search API
    • Constructor Detail

      • SearchApi

        public SearchApi​(GitLabApi gitLabApi)
    • Method Detail

      • globalSearch

        public <T> java.util.List<T> globalSearch​(Constants.SearchScope<T> scope,
                                                  java.lang.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 <T> java.util.stream.Stream<T> globalSearchStream​(Constants.SearchScope<T> scope,
                                                                 java.lang.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 <T> Pager<T> globalSearch​(Constants.SearchScope<T> scope,
                                         java.lang.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 <T> java.util.List<T> groupSearch​(java.lang.Object groupIdOrPath,
                                                 Constants.GroupSearchScope<T> scope,
                                                 java.lang.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 <T> java.util.stream.Stream<T> groupSearchStream​(java.lang.Object groupIdOrPath,
                                                                Constants.GroupSearchScope<T> scope,
                                                                java.lang.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 <T> Pager<T> groupSearch​(java.lang.Object groupIdOrPath,
                                        Constants.GroupSearchScope<T> scope,
                                        java.lang.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 <T> java.util.List<T> projectSearch​(java.lang.Object projectIdOrPath,
                                                   Constants.ProjectSearchScope<T> scope,
                                                   java.lang.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 <T> java.util.List<T> projectSearch​(java.lang.Object projectIdOrPath,
                                                   Constants.ProjectSearchScope<T> scope,
                                                   java.lang.String search,
                                                   java.lang.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 <T> java.util.stream.Stream<T> projectSearchStream​(java.lang.Object projectIdOrPath,
                                                                  Constants.ProjectSearchScope<T> scope,
                                                                  java.lang.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 <T> java.util.stream.Stream<T> projectSearchStream​(java.lang.Object projectIdOrPath,
                                                                  Constants.ProjectSearchScope<T> scope,
                                                                  java.lang.String search,
                                                                  java.lang.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 <T> Pager<T> projectSearch​(java.lang.Object projectIdOrPath,
                                          Constants.ProjectSearchScope<T> scope,
                                          java.lang.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 <T> Pager<T> projectSearch​(java.lang.Object projectIdOrPath,
                                          Constants.ProjectSearchScope<T> scope,
                                          java.lang.String search,
                                          java.lang.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