public interface SearchService
| Modifier and Type | Method and Description |
|---|---|
String |
calculateExtremeValue(Context context,
String valueField,
String sortField,
DiscoverQuery.SORT_ORDER sortOrder)
This method returns us either the highest or lowest value for the field that we give to it
depending on what sortOrder we give this method.
|
String |
createLocationQueryForAdministrableItems(Context context)
Method to create a Query that includes all
communities and collections a user may administrate.
|
String |
escapeQueryChars(String query)
Utility method to escape any special characters in a user's query
|
FacetYearRange |
getFacetYearRange(Context context,
IndexableObject scope,
DiscoverySearchFilterFacet facet,
List<String> filterQueries,
DiscoverQuery parentQuery) |
List<Item> |
getRelatedItems(Context context,
Item item,
DiscoveryMoreLikeThisConfiguration moreLikeThisConfiguration) |
DiscoverResult |
search(Context context,
DiscoverQuery query)
Convenient method to call @see #search(Context, DSpaceObject,
DiscoverQuery) with a null DSpace Object as scope (i.e.
|
DiscoverResult |
search(Context context,
DiscoverQuery query,
boolean includeWithdrawn) |
DiscoverResult |
search(Context context,
IndexableObject dso,
DiscoverQuery query)
Convenient method to call @see #search(Context, DSpaceObject,
DiscoverQuery, boolean) with includeWithdrawn=false
|
DiscoverResult |
search(Context context,
IndexableObject dso,
DiscoverQuery query,
boolean includeWithdrawn) |
List<IndexableObject> |
search(Context context,
String query,
String orderfield,
boolean ascending,
int offset,
int max,
String... filterquery) |
DiscoverFilterQuery |
toFilterQuery(Context context,
String field,
String operator,
String value)
Transforms the given string field and value into a filter query
|
String |
toSortFieldIndex(String metadataField,
String type)
Transforms the metadata field of the given sort configuration into the indexed field which we can then use in
our Solr queries.
|
DiscoverResult search(Context context, DiscoverQuery query) throws SearchServiceException
context - DSpace Context object.query - the discovery query object.SearchServiceException - if search errorDiscoverResult search(Context context, IndexableObject dso, DiscoverQuery query) throws SearchServiceException
context - DSpace Context objectdso - a DSpace Object to use as scope of the search (only results
within this object)query - the discovery query objectSearchServiceException - if search errorDiscoverResult search(Context context, DiscoverQuery query, boolean includeWithdrawn) throws SearchServiceException
context - DSpace Context object.query - the discovery query object.includeWithdrawn - use true to include in the results also withdrawn
items that match the query.SearchServiceException - if search errorDiscoverResult search(Context context, IndexableObject dso, DiscoverQuery query, boolean includeWithdrawn) throws SearchServiceException
context - DSpace Context objectdso - a DSpace Object to use as scope of the search (only results
within this object)query - the discovery query objectincludeWithdrawn - use true to include in the results also withdrawn
items that match the querySearchServiceException - if search errorList<IndexableObject> search(Context context, String query, String orderfield, boolean ascending, int offset, int max, String... filterquery)
DiscoverFilterQuery toFilterQuery(Context context, String field, String operator, String value) throws SQLException
context - The relevant DSpace Context.field - the field of the filter queryoperator - equals/notequals/notcontains/authority/notauthorityvalue - the filter query valueSQLException - if database error
An exception that provides information on a database access error or other errors.List<Item> getRelatedItems(Context context, Item item, DiscoveryMoreLikeThisConfiguration moreLikeThisConfiguration)
String createLocationQueryForAdministrableItems(Context context) throws SQLException
context - The relevant DSpace Context.SQLException - An exception that provides information on a database access error or other errors.String toSortFieldIndex(String metadataField, String type)
metadataField - the metadata fieldtype - see DiscoveryConfigurationParametersString escapeQueryChars(String query)
query - User's query to escape.FacetYearRange getFacetYearRange(Context context, IndexableObject scope, DiscoverySearchFilterFacet facet, List<String> filterQueries, DiscoverQuery parentQuery) throws SearchServiceException
SearchServiceExceptionString calculateExtremeValue(Context context, String valueField, String sortField, DiscoverQuery.SORT_ORDER sortOrder) throws SearchServiceException
context - The relevant DSpace contextvalueField - The field in solr for which we'll calculate the extreme valuesortField - The field in solr for which we'll sort the calculated extreme value on
This is typically the valueField appended with "_sort"sortOrder - Entering ascending will return the minimum value
Entering descending will return the maximum valueSearchServiceExceptionCopyright © 2019 DuraSpace. All rights reserved.