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
ISearch
which are relied upon by Confluence's V2 search API.- See Also:
SearchIndexAccessor
,SearchManager
-
-
Field Summary
Fields Modifier and Type Field Description protected EnumSet<SearchIndex>
indexes
protected int
limit
protected SearchQuery
query
protected SearchSort
sort
protected int
startOffset
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSearch(EnumSet<SearchIndex> indexes, @NonNull SearchQuery query, SearchSort sort)
Constructs an abstract representation of a search to be performed.protected
AbstractSearch(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 boolean
equals(Object obj)
int
getLimit()
@NonNull SearchQuery
getQuery()
Gets the query component of the searchEnumSet<SearchIndex>
getSearchIndexes()
Specifies which indexes should be targeted for this particular search.SearchSort
getSort()
Gets the sort component of the searchint
getStartOffset()
int
hashCode()
-
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 theindexes
sort
- 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 theindexes
non-null.sort
- how to order the results of thequery
startOffset
- 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:
getStartOffset
in interfaceISearch
- Returns:
- the start offset (0 based).
-
getLimit
public int getLimit()
-
getSearchIndexes
public EnumSet<SearchIndex> getSearchIndexes()
Description copied from interface:ISearch
Specifies which indexes should be targeted for this particular search.- Specified by:
getSearchIndexes
in interfaceISearch
-
-