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
Nested ClassesModifier and TypeClassDescriptionprotected static classNested classes/interfaces inherited from interface com.atlassian.confluence.search.v2.ISearch
ISearch.Builder<SEARCH extends ISearch> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final intprotected final SearchQueryprotected final SearchSortprotected final intFields inherited from interface com.atlassian.confluence.search.v2.ISearch
ENABLE_LUCENE_QUERY_EXPLAIN -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSearch(AbstractSearch.AbstractBuilder<?> builder) Constructs an abstract representation of a search to be performed.protectedAbstractSearch(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.protectedAbstractSearch(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 TypeMethodDescriptionbooleanbooleanSpecifies whether the resultingSearchResults.getNextPageSearch()will be generated with a token.intgetLimit()@NonNull SearchQuerygetQuery()Gets the query component of the searchIMPORTANT: Use the new getIndices method instead.getSort()Gets the sort component of the searchintinthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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 theindexessort- 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 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
-
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:
getStartOffsetin interfaceISearch- Returns:
- the start offset (0 based).
-
getLimit
public int getLimit() -
getSearchIndexes
Description copied from interface:ISearchIMPORTANT: Use the new getIndices method instead. Specifies which indexes should be targeted for this particular search.- Specified by:
getSearchIndexesin interfaceISearch
-
getIndices
- Specified by:
getIndicesin interfaceISearch- Returns:
- a list of indexes should be targeted
-
generatesToken
public boolean generatesToken()Description copied from interface:ISearchSpecifies 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:
generatesTokenin interfaceISearch- Returns:
- true if
SearchResults.getNextPageSearch()should be generated with a token
-
equals
-
hashCode
public int hashCode()
-