public interface SearchService extends Service
Modifier and Type | Method and Description |
---|---|
int |
addBookmarks(List<AssetId> assets)
Bookmarks the specified assets.
|
boolean |
deleteSmartList(long smartListId)
Deletes a smart list.
|
List<BookmarkBean> |
getBookmarks()
Returns the list of bookmarks for the logged in user in the logged in site.
|
List<AttributeDef> |
getSearchEnabledAttributes(String type, String subType)
Returns a list of
AttributeDef objects for the attributes on which search has been enabled. |
SmartList |
getSmartList(long smartListId)
Returns the smart list with the specified id.
|
List<SmartList> |
getSmartLists()
Returns all smart lists for the logged in user in the logged in site.
|
boolean |
isSearchEnabled(String assetType)
Returns true if search is enabled for the specified asset type.
|
boolean |
removeBookmarks(List<AssetId> bookmarks)
Removes the bookmark for the specified assets, if any.
|
boolean |
saveSmartList(SmartList smartList, MessageCollectors.SmartListMessageCollector collector)
Saves the specified smart list.
|
List<ResultRow> |
search(long siteId, String phrase, String phraseOperation, List<TypeBean> assetTypes, String searchfield, int maxResults, List<SortOrder> sortby)
Returns search results for the specified search parameters.
|
List<ResultRow> |
search(SearchCriteria searchCriteria, int maxResults, List<SortOrder> sortby)
Returns search results for the specified search criteria.
|
getManager, getResponse, setManager
boolean isSearchEnabled(String assetType) throws ServiceException
assetType
- the asset type on which to check if search has been enabled.ServiceException
- wraps any exception underlying the service call.List<AttributeDef> getSearchEnabledAttributes(String type, String subType) throws ServiceException
AttributeDef
objects for the attributes on which search has been enabled. If there are no attributes on which search is enabled, this method returns an empty list. This method assumes that search index has been enabled on the specified asset type. If search is not enabled on the specified asset type, the method returns an empty list.type
- the asset type to which the attributes belong.subType
- the sub-type (for asset maker assets) or definition (for Flex assets).AttributeDef
instances for which search is enabled.ServiceException
- wraps any exception underlying the service call.List<ResultRow> search(long siteId, String phrase, String phraseOperation, List<TypeBean> assetTypes, String searchfield, int maxResults, List<SortOrder> sortby) throws ServiceException
siteId
- the site on which to perform the search.Only assets available in this site will be returned.phrase
- search phrase.phraseOperation
- operation for the search to be performed on the phrase, e.g. CONTAINS
, defaults to Operation.CONTAINS
assetTypes
- the type and sub-type of assets to search. If exactly one type sub-type combination is specified,this method uses the search index for that asset type.If the search index is not enabled, the method throws a ServiceException
.searchfield
- the field to search for. If the field is not specified, the method uses the default search field configured for the index.maxResults
- maximum search results to be returned.sortby
- sort orders for sorting the results.ServiceException
- wraps any exception underlying the service call.Operation
, SortOrder
List<ResultRow> search(SearchCriteria searchCriteria, int maxResults, List<SortOrder> sortby) throws ServiceException
Operation.CONTAINS
operation for phrases in the search criteria. This method will use the asset type based search index if it is enabled for the asset type specified in the search criteria. Otherwise, it will use the Global Index. The default search field for the search index will be used for search.searchCriteria
- search criteria which can provide for search parameters like: the site on which to perform the search, search phrase, the type and sub-type of the assets to search,maxResults
- maximum search results to be returned .sortby
- sort orders for sorting the results.ServiceException
- wraps any exception underlying the service call.SearchCriteria
, SortOrder
List<SmartList> getSmartLists() throws ServiceException
ServiceException
- wraps any exception underlying the service call.SmartList getSmartList(long smartListId) throws ServiceException
smartListId
- the id of the smart list to load.ServiceException
- wraps any exception underlying the service call.boolean saveSmartList(SmartList smartList, MessageCollectors.SmartListMessageCollector collector) throws ServiceException
smartList
- the smart list to save.collector
- SmartListMessageCollector populates with messages.ServiceException
- wraps any exception underlying the service call.boolean deleteSmartList(long smartListId) throws ServiceException
smartListId
- id of the smart list to delete.ServiceException
- wraps any exception underlying the service call.List<BookmarkBean> getBookmarks() throws ServiceException
ServiceException
- wraps any exception underlying the service call.int addBookmarks(List<AssetId> assets) throws ServiceException
assets
- the assets to be bookmarked.ServiceException
- wraps any exception underlying the service call.boolean removeBookmarks(List<AssetId> bookmarks) throws ServiceException
bookmarks
- the assets for which the bookmarks need to be removed.ServiceException
- wraps any exception underlying the service call.