Package org.dspace.discovery
Class SearchUtils
- java.lang.Object
-
- org.dspace.discovery.SearchUtils
-
public class SearchUtils extends Object
Util methods used by discovery- Author:
- Kevin Van de Velde (kevin at atmire dot com), Mark Diggory (markd at atmire dot com), Ben Bosman (ben at atmire dot com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTHORITY_SEPARATORstatic StringFILTER_SEPARATORstatic StringLAST_INDEXED_FIELDstatic StringNAMED_RESOURCE_TYPEstatic StringRESOURCE_ID_FIELDstatic StringRESOURCE_TYPE_FIELDstatic StringRESOURCE_UNIQUE_ID
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearCachedSearchService()Clear the cachedSearchServiceinstance, forcing it to be retrieved from the service manager again next timegetSearchService()is called.static List<DiscoveryConfiguration>getAllDiscoveryConfigurations(Item item)Method that retrieves a list of all the configuration objects from the given item A configuration object can be returned for each parent community/collectionstatic List<DiscoveryConfiguration>getAllDiscoveryConfigurations(WorkspaceItem witem)Return all the discovery configuration applicable to the provided workspace itemstatic List<DiscoveryConfiguration>getAllDiscoveryConfigurations(WorkflowItem witem)Return all the discovery configuration applicable to the provided workflow itemstatic DiscoveryConfigurationServicegetConfigurationService()static DiscoveryConfigurationgetDiscoveryConfiguration()static DiscoveryConfigurationgetDiscoveryConfiguration(String prefix, DSpaceObject dso)Return the discovery configuration to use in a specific scope for the king of search identified by the prefix.static DiscoveryConfigurationgetDiscoveryConfiguration(DSpaceObject dso)static DiscoveryConfigurationgetDiscoveryConfigurationByName(String configurationName)Return the discovery configuration identified by the specified namestatic List<String>getIgnoredMetadataFields(int type)static DiscoverQueryBuildergetQueryBuilder()static SearchServicegetSearchService()Return an instance of theSearchService.
-
-
-
Field Detail
-
AUTHORITY_SEPARATOR
public static final String AUTHORITY_SEPARATOR
- See Also:
- Constant Field Values
-
LAST_INDEXED_FIELD
public static final String LAST_INDEXED_FIELD
- See Also:
- Constant Field Values
-
RESOURCE_UNIQUE_ID
public static final String RESOURCE_UNIQUE_ID
- See Also:
- Constant Field Values
-
RESOURCE_TYPE_FIELD
public static final String RESOURCE_TYPE_FIELD
- See Also:
- Constant Field Values
-
RESOURCE_ID_FIELD
public static final String RESOURCE_ID_FIELD
- See Also:
- Constant Field Values
-
NAMED_RESOURCE_TYPE
public static final String NAMED_RESOURCE_TYPE
- See Also:
- Constant Field Values
-
FILTER_SEPARATOR
public static final String FILTER_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSearchService
public static SearchService getSearchService()
Return an instance of theSearchService.
-
clearCachedSearchService
public static void clearCachedSearchService()
Clear the cachedSearchServiceinstance, forcing it to be retrieved from the service manager again next timegetSearchService()is called. In practice, this is only necessary for integration tests in some environments where the cached version may no longer be up to date between tests.
-
getDiscoveryConfiguration
public static DiscoveryConfiguration getDiscoveryConfiguration()
-
getDiscoveryConfiguration
public static DiscoveryConfiguration getDiscoveryConfiguration(DSpaceObject dso)
-
getDiscoveryConfiguration
public static DiscoveryConfiguration getDiscoveryConfiguration(String prefix, DSpaceObject dso)
Return the discovery configuration to use in a specific scope for the king of search identified by the prefix. A null prefix mean the normal query, other predefined values are workspace or workflow- Parameters:
prefix- the namespace of the configuration to lookup if anydso- the DSpaceObject- Returns:
- the discovery configuration for the specified scope
-
getDiscoveryConfigurationByName
public static DiscoveryConfiguration getDiscoveryConfigurationByName(String configurationName)
Return the discovery configuration identified by the specified name- Parameters:
configurationName- the configuration name assigned to the bean in the discovery.xml- Returns:
- the discovery configuration
-
getConfigurationService
public static DiscoveryConfigurationService getConfigurationService()
-
getAllDiscoveryConfigurations
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(Item item) throws SQLException
Method that retrieves a list of all the configuration objects from the given item A configuration object can be returned for each parent community/collection- Parameters:
item- the DSpace item- Returns:
- a list of configuration objects
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getAllDiscoveryConfigurations
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(WorkspaceItem witem) throws SQLException
Return all the discovery configuration applicable to the provided workspace item- Parameters:
witem- a workspace item- Returns:
- a list of discovery configuration
- Throws:
SQLException
-
getAllDiscoveryConfigurations
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(WorkflowItem witem) throws SQLException
Return all the discovery configuration applicable to the provided workflow item- Parameters:
witem- a workflow item- Returns:
- a list of discovery configuration
- Throws:
SQLException
-
getQueryBuilder
public static DiscoverQueryBuilder getQueryBuilder()
-
-