Class SearchResource


  • @PublicApi
    public class SearchResource
    extends Object
    API REST Resource for searching for entities in Confluence. Generally delegates to the CQLSearchService.
    • Constructor Detail

    • Method Detail

      • search

        public SearchPageResponse<SearchResult> search​(String cql,
                                                       String cqlcontext,
                                                       String excerpt,
                                                       String expand,
                                                       int offset,
                                                       String afterOffset,
                                                       int limit,
                                                       boolean includeArchivedSpaces,
                                                       @Context
                                                       javax.ws.rs.core.UriInfo uriInfo)
        Search for entities in Confluence using the Confluence Query Language (CQL)

        For example:

        Example request URI(s):

        • http://localhost:8080/confluence/rest/api/search?cql=creator=currentUser()&type%20in%20(space,page,user)&cqlcontext={%22spaceKey%22:%22TST%22, %22contentId%22:%2255%22}
        • http://localhost:8080/confluence/rest/api/search?cql=siteSearch~'example'%20AND%20label=docs&expand=content.space,space.homepage&limit=10

        Parameters:
        cql - the CQL query see advanced searching in confluence using CQL
        cqlcontext - the execution context for CQL functions, provides current space key and content id. If this is not provided some CQL functions will not be available.
        excerpt - the excerpt strategy to apply to the result, one of : indexed, highlight, none. This defaults to highlight.
        expand - the properties to expand on the search result, this may cause database requests for some properties
        start - the start point of the collection to return
        limit - the limit of the number of items to return, this may be restricted by fixed system limits
        includeArchivedSpaces - whether to include content in archived spaces in the result, this defaults to false
        Returns:
        a JSON representation of the list of search results that the user is permitted to see