Class AbstractSearch
- java.lang.Object
-
- com.atlassian.confluence.search.v2.AbstractSearch
-
- All Implemented Interfaces:
ISearch
- Direct Known Subclasses:
ChangesSearch,ContentSearch,CustomSearch,DefaultSearch
public abstract class AbstractSearch extends Object implements ISearch
An abstract representation of a search to be performed. Extend this class to create concrete types of searches. It is recommended to make use ofAbstractSearch(EnumSet, SearchQuery, SearchSort, int, int)when constructing a concrete implementation.This class provides fields and implementations of getters in
ISearchwhich are relied upon by Confluence's V2 search API.- See Also:
SearchIndexAccessor,SearchManager
-
-
Field Summary
Fields Modifier and Type Field Description protected EnumSet<SearchIndex>indexesprotected intlimitprotected SearchQueryqueryprotected SearchSortsortprotected intstartOffset
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSearch(EnumSet<SearchIndex> indexes, @NonNull SearchQuery query, SearchSort sort)Constructs an abstract representation of a search to be performed.protectedAbstractSearch(EnumSet<SearchIndex> indexes, @NonNull SearchQuery query, SearchSort sort, int startOffset, int limit)Constructs an abstract representation of a search to be performed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetLimit()@NonNull SearchQuerygetQuery()Gets the query component of the searchEnumSet<SearchIndex>getSearchIndexes()Specifies which indexes should be targeted for this particular search.SearchSortgetSort()Gets the sort component of the searchintgetStartOffset()inthashCode()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.search.v2.ISearch
getHighlight, getSearchType, isExplain
-
-
-
-
Field Detail
-
indexes
protected final EnumSet<SearchIndex> indexes
-
query
protected final SearchQuery query
-
sort
protected final SearchSort sort
-
startOffset
protected final int startOffset
-
limit
protected final int limit
-
-
Constructor Detail
-
AbstractSearch
protected AbstractSearch(EnumSet<SearchIndex> indexes, @NonNull SearchQuery query, SearchSort sort)
Constructs an abstract representation of a search to be performed. The maximum number of results returned will be a system provided default.- Parameters:
indexes- the non-empty, non-null set of indexes which will be searchedquery- the non-null query to perform on theindexessort- how to order the results of thequery
-
AbstractSearch
protected AbstractSearch(EnumSet<SearchIndex> indexes, @NonNull SearchQuery query, SearchSort sort, int startOffset, int limit)
Constructs an abstract representation of a search to be performed.- Parameters:
indexes- the indexes which will be searched, non-empty.query- the query to perform on theindexesnon-null.sort- how to order the results of thequerystartOffset- the zero-based offset of the first result to returnlimit- the maximum number of results to return
-
-
Method Detail
-
getQuery
public @NonNull SearchQuery getQuery()
Gets the query component of the search
-
getSort
public SearchSort getSort()
Gets the sort component of the search
-
getStartOffset
public int getStartOffset()
- Specified by:
getStartOffsetin interfaceISearch- Returns:
- the start offset (0 based).
-
getLimit
public int getLimit()
-
getSearchIndexes
public EnumSet<SearchIndex> getSearchIndexes()
Description copied from interface:ISearchSpecifies which indexes should be targeted for this particular search.- Specified by:
getSearchIndexesin interfaceISearch
-
-