Interface ISearch

  • All Known Subinterfaces:
    SearchWithToken
    All Known Implementing Classes:
    AbstractSearch, ChangesSearch, ContentSearch, CustomSearch, DefaultSearch, DefaultSearchWithToken

    public interface ISearch
    A representation of a search to be performed. Searches are immutable, and consist of these parts:
    1. The SearchIndex(s) to perform the search on.
    2. The SearchQuery to be performed.
    3. The SearchSort describing the order to apply to the results.
    4. The zero-based startOffset of the results of the search.
    5. The limit or maximum number of results to return.
    6. isExplain indicating whether or not to provide explanation for the query.
    7. The HighlightParams describing how to highlight the search.
    WARNING: SearchIndex(s), startOffset, limit, and isExplain must be provided. The rest can be null, or empty (if a Collection) or not present (if an Optional).

    Implementations of this interface will provide fields which are relied upon by Confluence's V2 search API.

    It is recommended to extend AbstractSearch when providing a concrete implementation of this interface.

    See Also:
    SearchIndexAccessor, SearchManager, AbstractSearch
    • Method Detail

      • getQuery

        @NonNull SearchQuery getQuery()
        Returns:
        the non-null query component of the search
      • getSort

        SearchSort getSort()
        Returns:
        the sort component of the search
      • getStartOffset

        int getStartOffset()
        Returns:
        the start offset (0 based).
      • getLimit

        int getLimit()
        Returns:
        the maximum page size (positive).
      • getSearchType

        default String getSearchType()
        Returns type of search e.g. SiteSearch, RecentUpdate, NetworkFeed, BlogUpdate, which can be used by search manager to switch between different implementations to support incremental roll out.
        Returns:
        type of search
      • isExplain

        default boolean isExplain()
      • getSearchIndexes

        default EnumSet<SearchIndex> getSearchIndexes()
        Specifies which indexes should be targeted for this particular search.