|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SearchManager
Facade for the v2 search API.
Nested Class Summary | |
---|---|
static class |
SearchManager.EntityVersionPolicy
Determines how search results will be converted into entities by convertToEntities(SearchResults, EntityVersionPolicy) and
searchEntities(ISearch, EntityVersionPolicy) . |
Method Summary | |
---|---|
java.util.List<com.atlassian.bonnie.Searchable> |
convertToEntities(SearchResults searchResults,
boolean stripNull)
Deprecated. since 4.0. Use convertToEntities(SearchResults, EntityVersionPolicy) instead. |
java.util.List<com.atlassian.bonnie.Searchable> |
convertToEntities(SearchResults searchResults,
SearchManager.EntityVersionPolicy versionPolicy)
Helper method to convert search results into a list of database entities. |
SearchResults |
search(ISearch search)
Perform a search with a given criteria. |
SearchResults |
search(ISearch search,
java.util.Set<java.lang.String> requestedFields)
Perform a search with a given criteria, the returns searchResults only have the fields requested in the projection filled out, no other fields are valid in the searchResult. |
SearchResults |
search(Search search)
Deprecated. since 3.0. Use search(ISearch) by passing in a ContentSearch . |
java.util.List<com.atlassian.bonnie.Searchable> |
searchEntities(ISearch search)
Deprecated. since 4.0 use searchEntities(ISearch, EntityVersionPolicy) instead. |
java.util.List<com.atlassian.bonnie.Searchable> |
searchEntities(ISearch search,
SearchManager.EntityVersionPolicy versionPolicy)
Perform a search with the given criteria, returning the results as a list of database entity objects. |
java.util.List<com.atlassian.bonnie.Searchable> |
searchEntities(Search search)
Deprecated. since 3.0. Use searchEntities(ISearch, EntityVersionPolicy) instead. |
Method Detail |
---|
SearchResults search(ISearch search) throws InvalidSearchException
Will throw an InvalidSearchException if some error occurred converting the search object into a search that could be performed in the back-end. Usually this is a sign that some plugin that was used to create the search is no longer available.
search
- the search to perform
java.lang.IllegalArgumentException
- if the search contains an invalid SearchQuery
InvalidSearchException
- when this manager is unable to translate and conduct the specified search. Clients should just discard the search if this occurs.SearchResults search(ISearch search, java.util.Set<java.lang.String> requestedFields) throws InvalidSearchException
FieldNotRequestedException
if an attempt is made to access a field value that has not
had it's key included in the projection Set.
Will throw an InvalidSearchException if some error occurred converting the search object into a search that could be performed in the back-end. Usually this is a sign that some plugin that was used to create the search is no longer available.
search
- requestedFields
-
InvalidSearchException
@Deprecated SearchResults search(Search search) throws InvalidSearchException
search(ISearch)
by passing in a ContentSearch
.
InvalidSearchException
Search
,
ContentSearch
java.util.List<com.atlassian.bonnie.Searchable> searchEntities(ISearch search, SearchManager.EntityVersionPolicy versionPolicy) throws InvalidSearchException
convertToEntities(SearchResults, EntityVersionPolicy)
method, the list of entities returned
will not contain any nulls: search results that do not match a database record will be silently
discarded.
The versionPolicy determines whether the entities returned should be the same version
as stored in the index (SearchManager.EntityVersionPolicy.INDEXED_VERSION
) or the latest version of
the same content (SearchManager.EntityVersionPolicy.LATEST_VERSION
). If you don't have a particular need
to retrieve the latest version, it is recommended that you retrieve the indexed version so that
any permission changes made to the document when updating it will be respected.
search
- the search to performversionPolicy
- whether to retrieve the indexed version of content found via search (recommended), or the latest
version of content (not recommended)
java.lang.IllegalArgumentException
- if the search contains an invalid SearchQuery
InvalidSearchException
- when this manager is unable to translate and conduct the specified search. Clients should just discard the search if this occurs.@Deprecated java.util.List<com.atlassian.bonnie.Searchable> searchEntities(ISearch search) throws InvalidSearchException
searchEntities(ISearch, EntityVersionPolicy)
instead.
InvalidSearchException
@Deprecated java.util.List<com.atlassian.bonnie.Searchable> searchEntities(Search search) throws InvalidSearchException
searchEntities(ISearch, EntityVersionPolicy)
instead.
InvalidSearchException
java.util.List<com.atlassian.bonnie.Searchable> convertToEntities(SearchResults searchResults, SearchManager.EntityVersionPolicy versionPolicy)
SearchManager.EntityVersionPolicy.INDEXED_VERSION
, which
is the recommended default, the returned entities will be the same version as found in the index.
If it is set to SearchManager.EntityVersionPolicy.LATEST_VERSION
, the latest version of the content will be
returned. Using the latest version is not recommended because it can mean permissions added
to the document when it was most recently updated may not be respected.
searchResults
- the results of a search from this managerversionPolicy
- whether to retrieve the indexed version of content found via search (recommended), or the latest
version of content (not recommended)
java.util.List<com.atlassian.bonnie.Searchable> convertToEntities(SearchResults searchResults, boolean stripNull)
convertToEntities(SearchResults, EntityVersionPolicy)
instead.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |