Interface ISearch
-
- All Known Subinterfaces:
SearchWithToken
- All Known Implementing Classes:
AbstractSearch,ChangesSearch,ContentSearch,CustomSearch,DefaultSearch,DefaultSearchWithToken
public interface ISearchA representation of a search to be performed. Searches are immutable, and consist of these parts:- The SearchIndex(s) to perform the search on.
- The SearchQuery to be performed.
- The SearchSort describing the order to apply to the results.
- The zero-based startOffset of the results of the search.
- The limit or maximum number of results to return.
- isExplain indicating whether or not to provide explanation for the query.
- The HighlightParams describing how to highlight the search.
- Deprecated: The ResultFilter to allow filtering of results after the search has completed. Use SearchQuery instead.
- Deprecated: The SearchFilter to filter search results during search. Use SearchQuery instead.
Implementations of this interface will provide fields which are relied upon by Confluence's V2 search API.
It is recommended to extend
AbstractSearchwhen providing a concrete implementation of this interface.- See Also:
SearchIndexAccessor,SearchManager,AbstractSearch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Optional<HightlightParams>getHighlight()Provides indication as well as pre/post tag whether query terms should be highlighted in title and body of a search result.intgetLimit()@NonNull SearchQuerygetQuery()default ResultFiltergetResultFilter()Deprecated.since 5.5.default SearchFiltergetSearchFilter()Deprecated.since 7.20,SearchFilterhas been replaced bySearchQuery.default EnumSet<SearchIndex>getSearchIndexes()Specifies which indexes should be targeted for this particular search.default StringgetSearchType()Returns type of search e.g.SearchSortgetSort()intgetStartOffset()default booleanisExplain()
-
-
-
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
-
getSearchFilter
@Deprecated default SearchFilter getSearchFilter()
Deprecated.since 7.20,SearchFilterhas been replaced bySearchQuery. It will be removed when Lucene is upgraded to a version which no longer supportsFilter.- Returns:
- the search filter component of the search
-
getResultFilter
@Deprecated default ResultFilter getResultFilter()
Deprecated.since 5.5. Please consider implemetingSearchFilter. If you must perform post search filtering, you can filterSearchResultsreturned by the methods onSearchManager.Returns the result filter component of the search.Note: if a non-null ResultFilter is returned here, it will override
getStartOffset()andgetLimit()- Returns:
- the result filter 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
-
getHighlight
default Optional<HightlightParams> getHighlight()
Provides indication as well as pre/post tag whether query terms should be highlighted in title and body of a search result. SeeSearchResult.getDisplayTitleWithHighlights()andSearchResult.getResultExcerptWithHighlights().
-
isExplain
default boolean isExplain()
-
getSearchIndexes
default EnumSet<SearchIndex> getSearchIndexes()
Specifies which indexes should be targeted for this particular search.
-
-