com.fatwire.services
Interface SearchService

All Superinterfaces:
Service

public interface SearchService
extends Service

SearchService is needed for searching for qualified asset with given query It could search against a list of asset types or all asset types if not specified


Method Summary
 int addToActiveList(java.lang.String userId, java.util.List<AssetId> assets)
          Add the assets to active list
 boolean deleteSaveSearch(long saveSearchId)
          Deletes the save Search
 java.util.List<SmartList> getAllSaveSearch(java.lang.String userName, long siteId)
          returns save search object for the user and site
 java.util.List<AttributeDef> getEnabledAttributes(TypeBean type)
          Return the list of enabled attributes in search for an asset type
 SmartList getSaveSearch(long saveSearchId)
          Returns the save search object
 boolean isSearchEnabled(java.lang.String assetType)
          check whether search is enabled for the assetType
 boolean removeFromActiveList(java.util.List<java.lang.Long> activeListItems)
          Remove items from the active list
 boolean removeFromActiveList(java.lang.String UserID, java.util.List<java.lang.Long> activeListItems)
           
 java.util.List<ActiveListItemBean> retrieveBookmarks(java.lang.String userId, long siteId)
          Retrieve the assets from active list.
 java.util.List<AssetId> retrieveFromActiveList(java.lang.String userId, long siteId)
          Retrieve the assets from active list.
 boolean saveSearch(SmartList saveSearch)
          saves search criteria
 java.util.List<ResultRow> search(SearchCriteria searchCriteria, int maxResults, java.util.List<SortOrder> sortby)
          Advanced search
 java.util.List<ResultRow> search(java.lang.String phrase, long siteId, java.util.List<TypeBean> assetTypeSubType, int maxResults, java.util.List<SortOrder> sortby)
           
 java.util.List<ResultRow> search(java.lang.String phrase, java.lang.String phraseOperation, java.lang.String searchfield, long siteId, java.util.List<TypeBean> types, int maxResults, java.util.List<SortOrder> sortby)
           
 java.util.List<ResultRow> searchAssetType(java.lang.String assetType, long siteId, int maxResults, java.util.List<SortOrder> sortby)
           
 java.util.List<ResultRow> searchImmediateChildren(AssetId parentId, long siteId, int maxResults, java.util.List<SortOrder> sortby)
           
 java.util.List<ResultRow> searchTreeNode(java.util.List<AssetId> assetIdList, int maxQueryNum, int maxResults, long siteId, SortOrder sortby)
          Search TreeNode
 
Methods inherited from interface com.fatwire.services.Service
getManager, getResponse, setManager
 

Method Detail

search

java.util.List<ResultRow> search(java.lang.String phrase,
                                 long siteId,
                                 java.util.List<TypeBean> assetTypeSubType,
                                 int maxResults,
                                 java.util.List<SortOrder> sortby)
                                 throws ServiceException
Parameters:
phrase - Search string, it is normally the keywords to search.
siteId - site id.
assetTypeSubType - List of assetype, subtype on which search should be performed
maxResults - max total number of results to be returned
sortby - list of SortFields
Returns:
a list of search result from each index source
Throws:
ServiceException

search

java.util.List<ResultRow> search(java.lang.String phrase,
                                 java.lang.String phraseOperation,
                                 java.lang.String searchfield,
                                 long siteId,
                                 java.util.List<TypeBean> types,
                                 int maxResults,
                                 java.util.List<SortOrder> sortby)
                                 throws ServiceException
Parameters:
phrase - Search string, it is normally the keywords to search.
phraseOperation - Operation which will be applied on the indexed field to match with the phrase for example contains , starts with etc.
searchfield - Field in the index which will be searched for the phrase.
siteId - site id.
assetTypeSubType - List of assetype, subtype on which search should be performed
maxResults - max total number of results to be returned
sortby - list of SortFields
Returns:
a list of search result from each index source
Throws:
ServiceException

searchAssetType

java.util.List<ResultRow> searchAssetType(java.lang.String assetType,
                                          long siteId,
                                          int maxResults,
                                          java.util.List<SortOrder> sortby)
                                          throws ServiceException
Throws:
ServiceException

searchImmediateChildren

java.util.List<ResultRow> searchImmediateChildren(AssetId parentId,
                                                  long siteId,
                                                  int maxResults,
                                                  java.util.List<SortOrder> sortby)
                                                  throws ServiceException
Throws:
ServiceException

saveSearch

boolean saveSearch(SmartList saveSearch)
saves search criteria

Parameters:
saveSearch - - Save Search object
Returns:
true if it successful

getSaveSearch

SmartList getSaveSearch(long saveSearchId)
Returns the save search object

Parameters:
saveSearchIds - ID of the saved search
Returns:
object of saved search

deleteSaveSearch

boolean deleteSaveSearch(long saveSearchId)
Deletes the save Search

Parameters:
saveSearchId -
Returns:

getAllSaveSearch

java.util.List<SmartList> getAllSaveSearch(java.lang.String userName,
                                           long siteId)
returns save search object for the user and site

Parameters:
userName - user name
siteId - the site ID
Returns:
list of all saved searches.

isSearchEnabled

boolean isSearchEnabled(java.lang.String assetType)
check whether search is enabled for the assetType

Parameters:
assetType - the asset type
Returns:
true if search is enabled for the asset

getEnabledAttributes

java.util.List<AttributeDef> getEnabledAttributes(TypeBean type)
                                                  throws ServiceException
Return the list of enabled attributes in search for an asset type

Parameters:
assetType - the asset type
subtype - subtype of the asset
Returns:
list of attributes' definitions
Throws:
ServiceException

search

java.util.List<ResultRow> search(SearchCriteria searchCriteria,
                                 int maxResults,
                                 java.util.List<SortOrder> sortby)
                                 throws ServiceException
Advanced search

Parameters:
searchCriteria - search criteria
maxResults - maximum search results
sortby - list of SortFields
Returns:
list of search results
Throws:
ServiceException

addToActiveList

int addToActiveList(java.lang.String userId,
                    java.util.List<AssetId> assets)
                    throws ServiceException
Add the assets to active list

Parameters:
userId - user ID
assets - list of asset IDs to be added to the active list
Returns:
number of items added to the active list. If the item is already present in the active list it is not added.
Throws:
ServiceException

searchTreeNode

java.util.List<ResultRow> searchTreeNode(java.util.List<AssetId> assetIdList,
                                         int maxQueryNum,
                                         int maxResults,
                                         long siteId,
                                         SortOrder sortby)
                                         throws ServiceException
Search TreeNode

Parameters:
assetIdList - list of asset IDs
maxQueryNum - //TODO
maxResults - maximum search results
siteId - the site ID
Returns:
list of search results
Throws:
UIServiceException
ServiceException

retrieveFromActiveList

java.util.List<AssetId> retrieveFromActiveList(java.lang.String userId,
                                               long siteId)
                                               throws ServiceException
Retrieve the assets from active list.

Parameters:
userId - user ID
siteId - the site ID
Returns:
lists of assets
Throws:
ServiceException

retrieveBookmarks

java.util.List<ActiveListItemBean> retrieveBookmarks(java.lang.String userId,
                                                     long siteId)
                                                     throws ServiceException
Retrieve the assets from active list.

Parameters:
userId - user ID
siteId - the site ID
Returns:
lists of ActiveListItemBean
Throws:
ServiceException

removeFromActiveList

boolean removeFromActiveList(java.util.List<java.lang.Long> activeListItems)
                             throws ServiceException
Remove items from the active list

Parameters:
assets - list of active list items to be removed from activeList
Returns:
true if the assets are removed from active list otherwise return false
Throws:
ServiceException

removeFromActiveList

boolean removeFromActiveList(java.lang.String UserID,
                             java.util.List<java.lang.Long> activeListItems)
                             throws ServiceException
Parameters:
UserID -
assets - list of activeListItems to be removed from activeList
Returns:
true if the asset is removed otherwise return false
Throws:
ServiceException


Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.