java.lang.Object
com.atlassian.confluence.plugins.restapi.resources.SearchResource

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

  • Method Details

    • 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()invalid input: '&type'%20in%20(space,page,user)invalid input: '&cqlcontext'={%22spaceKey%22:%22TST%22, %22contentId%22:%2255%22}
      • http://localhost:8080/confluence/rest/api/search?cql=siteSearch~'example'%20AND%20label=docsinvalid input: '&expand'=content.space,space.homepageinvalid input: '&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
      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
      start - the start point of the collection to return
      Returns:
      a JSON representation of the list of search results that the user is permitted to see