Class AbstractSearch
java.lang.Object
com.atlassian.confluence.search.v2.AbstractSearch
- All Implemented Interfaces:
ISearch
- Direct Known Subclasses:
ChangesSearch
,ContentSearch
,DefaultSearch
An abstract representation of a search to be performed. Extend this class to create concrete types of searches.
It is recommended to make use of
AbstractSearch(AbstractBuilder)
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Nested classes/interfaces inherited from interface com.atlassian.confluence.search.v2.ISearch
ISearch.Builder<SEARCH extends ISearch>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
protected final int
protected final SearchQuery
protected final SearchSort
protected final int
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractSearch
(AbstractSearch.AbstractBuilder<?> builder) Constructs an abstract representation of a search to be performed.protected
AbstractSearch
(EnumSet<SearchIndex> indexes, @NonNull SearchQuery query, SearchSort sort) Deprecated, for removal: This API element is subject to removal in a future version.since 9.0.protected
AbstractSearch
(List<Index> indexes, @NonNull SearchQuery query, SearchSort sort, int startOffset, int limit) Deprecated, for removal: This API element is subject to removal in a future version.since 9.0. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Specifies whether the resultingSearchResults.getNextPageSearch()
will be generated with a token.int
getLimit()
@NonNull SearchQuery
getQuery()
Gets the query component of the searchIMPORTANT: Use the new getIndices method instead.getSort()
Gets the sort component of the searchint
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, toBuilder, withIndices, withLimit, withQuery
-
Field Details
-
indices
-
query
-
sort
-
startOffset
protected final int startOffset -
limit
protected final int limit -
generatesToken
protected final boolean generatesToken
-
-
Constructor Details
-
AbstractSearch
@Deprecated(since="9.0", forRemoval=true) protected AbstractSearch(EnumSet<SearchIndex> indexes, @NonNull SearchQuery query, SearchSort sort) Deprecated, for removal: This API element is subject to removal in a future version.since 9.0. UseAbstractSearch(AbstractBuilder)
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
@Deprecated(since="9.0", forRemoval=true) protected AbstractSearch(List<Index> indexes, @NonNull SearchQuery query, SearchSort sort, int startOffset, int limit) Deprecated, for removal: This API element is subject to removal in a future version.since 9.0. UseAbstractSearch(AbstractBuilder)
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
-
AbstractSearch
Constructs an abstract representation of a search to be performed.- Parameters:
builder
-- Since:
- 9.0
-
-
Method Details
-
getQuery
Gets the query component of the search -
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
Description copied from interface:ISearch
IMPORTANT: Use the new getIndices method instead. Specifies which indexes should be targeted for this particular search.- Specified by:
getSearchIndexes
in interfaceISearch
-
getIndices
- Specified by:
getIndices
in interfaceISearch
- Returns:
- a list of indexes should be targeted
-
generatesToken
public boolean generatesToken()Description copied from interface:ISearch
Specifies whether the resultingSearchResults.getNextPageSearch()
will be generated with a token. A search token allows additional searching to be performed against a specific version of the index.Note: for backward compatibility reason, this value only applies to OpenSearch where it's especially costly to generate a token for every search request. On Lucene, this value is currently ignored, i.e. it will continue to generate a token for every search request. This may change in the future, so if you require a token, you should make this return true.
- Specified by:
generatesToken
in interfaceISearch
- Returns:
- true if
SearchResults.getNextPageSearch()
should be generated with a token
-
equals
-
hashCode
public int hashCode()
-