DS-4166 community feedback: code cleanup

This commit is contained in:
Andrea Bollini
2019-04-04 12:56:55 +02:00
parent 5e3164bd06
commit 6fd5a76837
9 changed files with 301 additions and 244 deletions

View File

@@ -379,10 +379,21 @@ public class DiscoverQuery {
return (int) (Math.ceil((float) (newestYear) / gap) * gap); return (int) (Math.ceil((float) (newestYear) / gap) * gap);
} }
/**
* Return the name of discovery configuration used by this query
*
* @return the discovery configuration name used
*/
public String getDiscoveryConfigurationName() { public String getDiscoveryConfigurationName() {
return discoveryConfigurationName; return discoveryConfigurationName;
} }
/**
* Set the name of discovery configuration to use to run this query
*
* @param discoveryConfigurationName
* the name of the discovery configuration to use to run this query
*/
public void setDiscoveryConfigurationName(String discoveryConfigurationName) { public void setDiscoveryConfigurationName(String discoveryConfigurationName) {
this.discoveryConfigurationName = discoveryConfigurationName; this.discoveryConfigurationName = discoveryConfigurationName;
} }

View File

@@ -179,6 +179,10 @@ public class DiscoverResult {
this.spellCheckQuery = spellCheckQuery; this.spellCheckQuery = spellCheckQuery;
} }
/**
* An utility class to represent the highlighting section of a Discovery Search
*
*/
public static final class IndexableObjectHighlightResult { public static final class IndexableObjectHighlightResult {
private IndexableObject indexableObject; private IndexableObject indexableObject;
private Map<String, List<String>> highlightResults; private Map<String, List<String>> highlightResults;
@@ -191,18 +195,42 @@ public class DiscoverResult {
this.highlightResultsWithAuthority = highlightResultsWithAuthority; this.highlightResultsWithAuthority = highlightResultsWithAuthority;
} }
/**
* Return the indexable object that the highlighting snippets refer to
*
* @return the indexable object
*/
public IndexableObject getIndexableObject() { public IndexableObject getIndexableObject() {
return indexableObject; return indexableObject;
} }
/**
* The matching snippets for a specific metadata ignoring any authority value
*
* @param metadataKey
* the metadata where the snippets have been found
* @return the matching snippets
*/
public List<String> getHighlightResults(String metadataKey) { public List<String> getHighlightResults(String metadataKey) {
return highlightResults.get(metadataKey); return highlightResults.get(metadataKey);
} }
/**
* The matching snippets for a specific metadata including the authority value if any
*
* @param metadataKey
* the metadata where the snippets have been found
* @return the matching snippets
*/
public List<String[]> getHighlightResultsWithAuthority(String metadataKey) { public List<String[]> getHighlightResultsWithAuthority(String metadataKey) {
return highlightResultsWithAuthority.get(metadataKey); return highlightResultsWithAuthority.get(metadataKey);
} }
/**
* All the matching snippets in whatever metadata ignoring any authority value
*
* @return All the matching snippets
*/
public Map<String, List<String>> getHighlightResults() { public Map<String, List<String>> getHighlightResults() {
return highlightResults; return highlightResults;
} }

View File

@@ -159,7 +159,7 @@ public class IndexEventConsumer implements Consumer {
* allow the search indexer to make * allow the search indexer to make
* decisions on indexing and/or removal * decisions on indexing and/or removal
*/ */
// iu = ctx.reloadEntity(o); iu = ctx.reloadEntity(iu);
String uniqueIndexID = iu.getUniqueIndexID(); String uniqueIndexID = iu.getUniqueIndexID();
if (uniqueIndexID != null && !uniqueIdsToDelete.contains(uniqueIndexID)) { if (uniqueIndexID != null && !uniqueIdsToDelete.contains(uniqueIndexID)) {
try { try {

View File

@@ -10,6 +10,7 @@ package org.dspace.discovery;
import java.io.Serializable; import java.io.Serializable;
import org.dspace.core.Constants; import org.dspace.core.Constants;
import org.dspace.core.ReloadableEntity;
/** /**
* This is the basic interface that a data model entity need to implement to be indexable in Discover * This is the basic interface that a data model entity need to implement to be indexable in Discover
@@ -19,7 +20,7 @@ import org.dspace.core.Constants;
* @param <PK> * @param <PK>
* the Class of the primary key * the Class of the primary key
*/ */
public interface IndexableObject<PK extends Serializable> { public interface IndexableObject<PK extends Serializable> extends ReloadableEntity<PK> {
/** /**
* *
@@ -27,12 +28,6 @@ public interface IndexableObject<PK extends Serializable> {
*/ */
public int getType(); public int getType();
/**
*
* @return the primary key of the Entity instance
*/
public PK getID();
/** /**
* *
* @return an unique id to index * @return an unique id to index

View File

@@ -58,6 +58,16 @@ public class SearchUtils {
return getDiscoveryConfiguration(null, dso); return getDiscoveryConfiguration(null, 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
*
* @param prefix
* the namespace of the configuration to lookup if any
* @param dso
* the DSpaceObject
* @return the discovery configuration for the specified scope
*/
public static DiscoveryConfiguration getDiscoveryConfiguration(String prefix, DSpaceObject dso) { public static DiscoveryConfiguration getDiscoveryConfiguration(String prefix, DSpaceObject dso) {
if (prefix != null) { if (prefix != null) {
return getDiscoveryConfigurationByName(dso != null ? prefix + "." + dso.getHandle() : prefix); return getDiscoveryConfigurationByName(dso != null ? prefix + "." + dso.getHandle() : prefix);
@@ -96,12 +106,24 @@ public class SearchUtils {
return getAllDiscoveryConfigurations(null, collections, item); return getAllDiscoveryConfigurations(null, collections, item);
} }
/**
* Return all the discovery configuration applicable to the provided workspace item
* @param witem a workspace item
* @return a list of discovery configuration
* @throws SQLException
*/
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(WorkspaceItem witem) throws SQLException { public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(WorkspaceItem witem) throws SQLException {
List<Collection> collections = new ArrayList<Collection>(); List<Collection> collections = new ArrayList<Collection>();
collections.add(witem.getCollection()); collections.add(witem.getCollection());
return getAllDiscoveryConfigurations("workspace", collections, witem.getItem()); return getAllDiscoveryConfigurations("workspace", collections, witem.getItem());
} }
/**
* Return all the discovery configuration applicable to the provided workflow item
* @param witem a workflow item
* @return a list of discovery configuration
* @throws SQLException
*/
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(WorkflowItem witem) throws SQLException { public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(WorkflowItem witem) throws SQLException {
List<Collection> collections = new ArrayList<Collection>(); List<Collection> collections = new ArrayList<Collection>();
collections.add(witem.getCollection()); collections.add(witem.getCollection());

View File

@@ -33,8 +33,6 @@ import java.util.Set;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.UUID; import java.util.UUID;
import java.util.Vector; import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@@ -170,8 +168,6 @@ public class SolrServiceImpl implements SearchService, IndexingService {
public static final String VARIANTS_STORE_SEPARATOR = "###"; public static final String VARIANTS_STORE_SEPARATOR = "###";
private static final String REGEX = "\\S+(?:\\s*\\|\\|\\|(\\s*\\S+))+";
@Autowired(required = true) @Autowired(required = true)
protected ContentServiceFactory contentServiceFactory; protected ContentServiceFactory contentServiceFactory;
@Autowired(required = true) @Autowired(required = true)
@@ -478,12 +474,18 @@ public class SolrServiceImpl implements SearchService, IndexingService {
Iterator<Item> items = itemService.findAllUnfiltered(context); Iterator<Item> items = itemService.findAllUnfiltered(context);
for (Item item : ImmutableList.copyOf(items)) { for (Item item : ImmutableList.copyOf(items)) {
indexContent(context, item, force); indexContent(context, item, force);
//To prevent memory issues, discard an object from the cache after processing
context.uncacheEntity(item);
} }
for (WorkspaceItem wsi : workspaceItemService.findAll(context)) { for (WorkspaceItem wsi : workspaceItemService.findAll(context)) {
indexContent(context, wsi.getItem(), force); indexContent(context, wsi.getItem(), force);
//To prevent memory issues, discard an object from the cache after processing
context.uncacheEntity(wsi);
} }
for (WorkflowItem wfi : workflowItemService.findAll(context)) { for (WorkflowItem wfi : workflowItemService.findAll(context)) {
indexContent(context, wfi.getItem(), force); indexContent(context, wfi.getItem(), force);
//To prevent memory issues, discard an object from the cache after processing
context.uncacheEntity(wfi);
} }
break; break;
case Constants.COLLECTION: case Constants.COLLECTION:
@@ -525,7 +527,9 @@ public class SolrServiceImpl implements SearchService, IndexingService {
if (force) { if (force) {
try { try {
getSolr().deleteByQuery( getSolr().deleteByQuery(
"search.resourcetype:[" + Constants.ITEM + " TO " + Constants.CLAIMEDTASK + "]"); "search.resourcetype:[" + Constants.ITEM + " TO " + Constants.COMMUNITY + "]" +
" AND " +
"search.resourcetype:[" + Constants.WORKSPACEITEM + " TO " + Constants.CLAIMEDTASK + "]");
} catch (Exception e) { } catch (Exception e) {
throw new SearchServiceException(e.getMessage(), e); throw new SearchServiceException(e.getMessage(), e);
} }
@@ -1066,16 +1070,16 @@ public class SolrServiceImpl implements SearchService, IndexingService {
"discovery.facet.namedtype." + typeText, "discovery.facet.namedtype." + typeText,
typeText + SolrServiceImpl.AUTHORITY_SEPARATOR + typeText); typeText + SolrServiceImpl.AUTHORITY_SEPARATOR + typeText);
if (StringUtils.isNotBlank(acvalue)) { if (StringUtils.isNotBlank(acvalue)) {
String fvalue = acvalue; addNamedResourceTypeIndex(doc, acvalue);
addNamedResourceTypeIndex(doc, acvalue, fvalue);
} }
// write the index and close the inputstreamreaders // write the index and close the inputstreamreaders
try { try {
writeDocument(doc, new FullTextContentStreams(context, item)); writeDocument(doc, new FullTextContentStreams(context, item));
log.info("Wrote Item: " + handle + " to Index"); log.info("Wrote Item: " + item.getUniqueIndexID() + " to Index");
} catch (RuntimeException e) { } catch (RuntimeException e) {
log.error("Error while writing item to discovery index: " + handle + " message:" + e.getMessage(), e); log.error("Error while writing item to discovery index: " + item.getUniqueIndexID() + " message:"
+ e.getMessage(), e);
} }
} }
@@ -1484,7 +1488,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
if (hitHighlightingFields.contains(field) || hitHighlightingFields if (hitHighlightingFields.contains(field) || hitHighlightingFields
.contains("*") || hitHighlightingFields.contains(unqualifiedField + "." + Item.ANY)) { .contains("*") || hitHighlightingFields.contains(unqualifiedField + "." + Item.ANY)) {
if (authority != null) { if (authority != null) {
doc.addField(field + "_hl", value + "###" + authority); doc.addField(field + "_hl", value + AUTHORITY_SEPARATOR + authority);
} else { } else {
doc.addField(field + "_hl", value); doc.addField(field + "_hl", value);
} }
@@ -1606,8 +1610,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
if (StringUtils.isBlank(acvalue)) { if (StringUtils.isBlank(acvalue)) {
acvalue = workspaceItem.getTypeText(); acvalue = workspaceItem.getTypeText();
} }
String fvalue = acvalue; addNamedResourceTypeIndex(doc, acvalue);
addNamedResourceTypeIndex(doc, acvalue, fvalue);
doc.addField("inprogress.item", item.getUniqueIndexID()); doc.addField("inprogress.item", item.getUniqueIndexID());
getSolr().add(doc); getSolr().add(doc);
@@ -1647,8 +1650,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
if (StringUtils.isBlank(acvalue)) { if (StringUtils.isBlank(acvalue)) {
acvalue = claimedTask.getTypeText(); acvalue = claimedTask.getTypeText();
} }
String fvalue = acvalue; addNamedResourceTypeIndex(claimDoc, acvalue);
addNamedResourceTypeIndex(claimDoc, acvalue, fvalue);
docs.add(claimDoc); docs.add(claimDoc);
} }
@@ -1673,8 +1675,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
if (StringUtils.isBlank(acvalue)) { if (StringUtils.isBlank(acvalue)) {
acvalue = poolTask.getTypeText(); acvalue = poolTask.getTypeText();
} }
String fvalue = acvalue; addNamedResourceTypeIndex(claimDoc, acvalue);
addNamedResourceTypeIndex(claimDoc, acvalue, fvalue);
docs.add(claimDoc); docs.add(claimDoc);
} }
} }
@@ -1684,8 +1685,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
if (StringUtils.isBlank(acvalue)) { if (StringUtils.isBlank(acvalue)) {
acvalue = workflowItem.getTypeText(); acvalue = workflowItem.getTypeText();
} }
String fvalue = acvalue; addNamedResourceTypeIndex(doc, acvalue);
addNamedResourceTypeIndex(doc, acvalue, fvalue);
addBasicInfoToDocument(doc, Constants.WORKFLOWITEM, workflowItem.getID(), null, locations); addBasicInfoToDocument(doc, Constants.WORKFLOWITEM, workflowItem.getID(), null, locations);
if (workflowItem.getSubmitter() != null) { if (workflowItem.getSubmitter() != null) {
@@ -2006,13 +2006,6 @@ public class SolrServiceImpl implements SearchService, IndexingService {
boolean isWorkflow = StringUtils.startsWith(discoveryQuery.getDiscoveryConfigurationName(), boolean isWorkflow = StringUtils.startsWith(discoveryQuery.getDiscoveryConfigurationName(),
DISCOVER_WORKFLOW_CONFIGURATION_NAME); DISCOVER_WORKFLOW_CONFIGURATION_NAME);
EPerson currentUser = context.getCurrentUser(); EPerson currentUser = context.getCurrentUser();
// Retrieve all the groups the current user is a member of !
Set<Group> groups;
try {
groups = groupService.allMemberGroupsSet(context, currentUser);
} catch (SQLException e) {
throw new org.dspace.discovery.SearchServiceException(e.getMessage(), e);
}
// extra security check to avoid the possibility that an anonymous user // extra security check to avoid the possibility that an anonymous user
// get access to workspace or workflow // get access to workspace or workflow
@@ -2024,6 +2017,14 @@ public class SolrServiceImpl implements SearchService, IndexingService {
solrQuery solrQuery
.addFilterQuery("submitter:(" + currentUser.getID() + ")"); .addFilterQuery("submitter:(" + currentUser.getID() + ")");
} else if (isWorkflow) { } else if (isWorkflow) {
// Retrieve all the groups the current user is a member of !
Set<Group> groups;
try {
groups = groupService.allMemberGroupsSet(context, currentUser);
} catch (SQLException e) {
throw new org.dspace.discovery.SearchServiceException(e.getMessage(), e);
}
// insert filter by controllers // insert filter by controllers
StringBuilder controllerQuery = new StringBuilder(); StringBuilder controllerQuery = new StringBuilder();
controllerQuery.append("taskfor:(e" + currentUser.getID()); controllerQuery.append("taskfor:(e" + currentUser.getID());
@@ -2187,20 +2188,6 @@ public class SolrServiceImpl implements SearchService, IndexingService {
return result; return result;
} }
public DiscoverResult.FacetResult getDiscoveryFacet(Context context, FacetField facetField,
FacetField.Count facetValue, String facetType) throws SQLException {
String displayedValue = transformDisplayedValue(context, facetField.getName(), facetValue.getName());
String authorityValue = transformAuthorityValue(context, facetField.getName(), facetValue.getName());
String sortValue = transformSortValue(context, facetField.getName(), facetValue.getName());
String filterValue = displayedValue;
if (StringUtils.isNotBlank(authorityValue)) {
filterValue = authorityValue;
}
DiscoverResult.FacetResult facetResult = new DiscoverResult.FacetResult(filterValue, displayedValue,
authorityValue, sortValue, facetValue.getCount(), facetType);
return facetResult;
}
/** /**
* Find the indexable object by type and UUID * Find the indexable object by type and UUID
* *
@@ -2609,30 +2596,38 @@ public class SolrServiceImpl implements SearchService, IndexingService {
* *
* @param document * @param document
* the solr document * the solr document
* @param acvalue * @param filterValue
* the authority value * the filter value (i.e. <sort_value>\n|||\n<display_value>###<authority_value>
* @param fvalue
* the human readable value
*/ */
private void addNamedResourceTypeIndex(SolrInputDocument document, String acvalue, String fvalue) { private void addNamedResourceTypeIndex(SolrInputDocument document, String filterValue) {
document.addField("namedresourcetype_filter", acvalue); document.addField("namedresourcetype_filter", filterValue);
String[] avalues = acvalue.split(SolrServiceImpl.AUTHORITY_SEPARATOR); // the separator for the filter can be eventually configured
acvalue = avalues[0]; String separator = DSpaceServicesFactory.getInstance().getConfigurationService()
.getProperty("discovery.solr.facets.split.char");
String avalue = avalues[1]; if (separator == null) {
document.addField("namedresourcetype_authority", avalue); separator = FILTER_SEPARATOR;
document.addField("namedresourcetype_group", avalue);
document.addField("namedresourcetype_ac", acvalue);
Pattern pattern = Pattern.compile(REGEX);
Matcher matcher = pattern.matcher(acvalue);
if (matcher.matches()) {
fvalue = matcher.group(1);
} }
document.addField("namedresourcetype_keyword", fvalue); // split the authority part from the sort/display
String[] avalues = filterValue.split(SolrServiceImpl.AUTHORITY_SEPARATOR);
String sortDisplayValues = avalues[0];
String authorityValue = avalues.length == 2 ? avalues[1] : filterValue;
// get the display value
int idxSeparator = sortDisplayValues.indexOf(separator);
String displayValue = idxSeparator != -1 ? sortDisplayValues.substring(idxSeparator + separator.length())
: sortDisplayValues;
document.addField("namedresourcetype_authority", authorityValue);
// build the solr fields used for the autocomplete
document.addField("namedresourcetype_ac", displayValue.toLowerCase() + separator + displayValue);
document.addField("namedresourcetype_acid", displayValue.toLowerCase() + separator + displayValue
+ SolrServiceImpl.AUTHORITY_SEPARATOR + authorityValue);
// build the solr field used for the keyword search
document.addField("namedresourcetype_keyword", displayValue);
} }
} }

View File

@@ -34,6 +34,7 @@ public class SearchFilterToAppliedFilterConverter {
// Moreover, it is not possible to discover which authority is responsible for the value selected in the // Moreover, it is not possible to discover which authority is responsible for the value selected in the
// facet as the authority is bind at the metadata level and so a facet could contains values from multiple // facet as the authority is bind at the metadata level and so a facet could contains values from multiple
// authorities // authorities
// https://jira.duraspace.org/browse/DS-4209
authorityValue = authorityValueService.findByUID(context, searchFilter.getValue()); authorityValue = authorityValueService.findByUID(context, searchFilter.getValue());
} }

View File

@@ -18,6 +18,12 @@ discovery.search.server = ${solr.server}/search
# discovery.index.ignore-authority = false # discovery.index.ignore-authority = false
discovery.index.projection=dc.title,dc.contributor.*,dc.date.issued discovery.index.projection=dc.title,dc.contributor.*,dc.date.issued
# Value used for the namedresourcetype facet used by the mydspace
# <sort-value>\n|||\n<display-value>###<authority-value>
# the separator between the sort-value and the display-value \n|||\n must
# match the value of the discovery.solr.facets.split.char defined above
# the sort-value can be used to force a fixed order for the facet if it is
# configured in the discovery.xml to be sorted by value
discovery.facet.namedtype.item = 000item\n|||\nArchived###item discovery.facet.namedtype.item = 000item\n|||\nArchived###item
discovery.facet.namedtype.workspace = 001workspace\n|||\nWorkspace###workspace discovery.facet.namedtype.workspace = 001workspace\n|||\nWorkspace###workspace
discovery.facet.namedtype.workflow.item = 002workflow\n|||\nWorkflow###workflow discovery.facet.namedtype.workflow.item = 002workflow\n|||\nWorkflow###workflow

View File

@@ -51,8 +51,8 @@
<entry key="site" value-ref="homepageConfiguration" /> <entry key="site" value-ref="homepageConfiguration" />
<!--<entry key="123456789/7621" value-ref="defaultConfiguration"/>--> <!--<entry key="123456789/7621" value-ref="defaultConfiguration"/>-->
<!-- Used to show filters and results on MyDSpace --> <!-- Used to show filters and results on MyDSpace -->
<entry key="workspace" value-ref="workspaceConfiguration" /> <entry key="workspace" value-ref="workspaceConfiguration" />
<entry key="workflow" value-ref="workflowConfiguration" /> <entry key="workflow" value-ref="workflowConfiguration" />
</map> </map>
</property> </property>
<property name="toIgnoreMetadataFields"> <property name="toIgnoreMetadataFields">
@@ -105,7 +105,7 @@
<ref bean="searchFilterAuthor" /> <ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" /> <ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterContentInOriginalBundle"/> <ref bean="searchFilterContentInOriginalBundle"/>
</list> </list>
</property> </property>
<!-- Set TagCloud configuration per discovery configuration --> <!-- Set TagCloud configuration per discovery configuration -->
@@ -117,7 +117,7 @@
<ref bean="searchFilterAuthor" /> <ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" /> <ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterContentInOriginalBundle"/> <ref bean="searchFilterContentInOriginalBundle"/>
<ref bean="searchFilterFileNameInOriginalBundle" /> <ref bean="searchFilterFileNameInOriginalBundle" />
<ref bean="searchFilterFileDescriptionInOriginalBundle" /> <ref bean="searchFilterFileDescriptionInOriginalBundle" />
</list> </list>
@@ -137,14 +137,14 @@
</property> </property>
</bean> </bean>
</property> </property>
<!--Any default filter queries, these filter queries will be used for all <!--Any default filter queries, these filter queries will be used for all
queries done by discovery for this configuration --> queries done by discovery for this configuration -->
<property name="defaultFilterQueries"> <property name="defaultFilterQueries">
<list> <list>
<!--Only find items, communities and collections--> <!--Only find items, communities and collections-->
<value>search.resourcetype:2 OR search.resourcetype:3 OR search.resourcetype:4</value> <value>search.resourcetype:2 OR search.resourcetype:3 OR search.resourcetype:4</value>
</list> </list>
</property> </property>
<!--The configuration for the recent submissions--> <!--The configuration for the recent submissions-->
<property name="recentSubmissionConfiguration"> <property name="recentSubmissionConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoveryRecentSubmissionsConfiguration"> <bean class="org.dspace.discovery.configuration.DiscoveryRecentSubmissionsConfiguration">
@@ -219,7 +219,7 @@
<ref bean="searchFilterAuthor" /> <ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" /> <ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterContentInOriginalBundle"/> <ref bean="searchFilterContentInOriginalBundle"/>
</list> </list>
</property> </property>
<!-- Set TagCloud configuration per discovery configuration --> <!-- Set TagCloud configuration per discovery configuration -->
@@ -231,7 +231,7 @@
<ref bean="searchFilterAuthor" /> <ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" /> <ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterContentInOriginalBundle"/> <ref bean="searchFilterContentInOriginalBundle"/>
<ref bean="searchFilterFileNameInOriginalBundle" /> <ref bean="searchFilterFileNameInOriginalBundle" />
<ref bean="searchFilterFileDescriptionInOriginalBundle" /> <ref bean="searchFilterFileDescriptionInOriginalBundle" />
</list> </list>
@@ -251,14 +251,14 @@
</property> </property>
</bean> </bean>
</property> </property>
<!--Any default filter queries, these filter queries will be used for all <!--Any default filter queries, these filter queries will be used for all
queries done by discovery for this configuration--> queries done by discovery for this configuration-->
<property name="defaultFilterQueries"> <property name="defaultFilterQueries">
<list> <list>
<!--Only find items, communities and collections--> <!--Only find items, communities and collections-->
<value>search.resourcetype:2 OR search.resourcetype:3 OR search.resourcetype:4</value> <value>search.resourcetype:2 OR search.resourcetype:3 OR search.resourcetype:4</value>
</list> </list>
</property> </property>
<!-- Limit recent submissions on homepage to only 5 (default is 20) --> <!-- Limit recent submissions on homepage to only 5 (default is 20) -->
<property name="recentSubmissionConfiguration"> <property name="recentSubmissionConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoveryRecentSubmissionsConfiguration"> <bean class="org.dspace.discovery.configuration.DiscoveryRecentSubmissionsConfiguration">
@@ -301,28 +301,27 @@
<property name="spellCheckEnabled" value="true"/> <property name="spellCheckEnabled" value="true"/>
</bean> </bean>
<!--The workspace configuration settings for discovery -->
<!--The workspace configuration settings for discovery --> <bean id="workspaceConfiguration"
<bean id="workspaceConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration"
class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype">
scope="prototype"> <property name="id" value="workspace" />
<property name="id" value="workspace" /> <!--Which sidebar facets are to be displayed -->
<!--Which sidebar facets are to be displayed --> <property name="sidebarFacets">
<property name="sidebarFacets"> <list>
<list> <ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterObjectNamedType" /> <ref bean="searchFilterType" />
<ref bean="searchFilterType" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterIssued" /> </list>
</list> </property>
</property> <!--The search filters which can be used on the discovery search page -->
<!--The search filters which can be used on the discovery search page --> <property name="searchFilters">
<property name="searchFilters"> <list>
<list> <ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterObjectNamedType" /> <ref bean="searchFilterType" />
<ref bean="searchFilterType" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterIssued" /> </list>
</list> </property>
</property>
<!--The sort filters for the discovery search--> <!--The sort filters for the discovery search-->
<property name="searchSortConfiguration"> <property name="searchSortConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration"> <bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
@@ -337,14 +336,14 @@
</property> </property>
</bean> </bean>
</property> </property>
<!--Any default filter queries, these filter queries will be used for all <!--Any default filter queries, these filter queries will be used for all
queries done by discovery for this configuration --> queries done by discovery for this configuration -->
<property name="defaultFilterQueries"> <property name="defaultFilterQueries">
<list> <list>
<!--Only find items, workspace and accepted for workflow --> <!--Only find items, workspace and accepted for workflow -->
<value>search.resourcetype:2 OR search.resourcetype:[8 TO 9]</value> <value>search.resourcetype:2 OR search.resourcetype:[8 TO 9]</value>
</list> </list>
</property> </property>
<!--Default result per page --> <!--Default result per page -->
<property name="defaultRpp" value="10" /> <property name="defaultRpp" value="10" />
<property name="hitHighlightingConfiguration"> <property name="hitHighlightingConfiguration">
@@ -376,30 +375,30 @@
<!-- When true a "did you mean" example will be displayed, value can be true or false --> <!-- When true a "did you mean" example will be displayed, value can be true or false -->
<property name="spellCheckEnabled" value="true"/> <property name="spellCheckEnabled" value="true"/>
</bean> </bean>
<!--The workflow configuration settings for discovery --> <!--The workflow configuration settings for discovery -->
<bean id="workflowConfiguration" <bean id="workflowConfiguration"
class="org.dspace.discovery.configuration.DiscoveryConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration"
scope="prototype"> scope="prototype">
<property name="id" value="workflow" /> <property name="id" value="workflow" />
<!--Which sidebar facets are to be displayed --> <!--Which sidebar facets are to be displayed -->
<property name="sidebarFacets"> <property name="sidebarFacets">
<list> <list>
<ref bean="searchFilterObjectNamedType" /> <ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterType" /> <ref bean="searchFilterType" />
<ref bean="searchFilterIssued" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterSubmitter" /> <ref bean="searchFilterSubmitter" />
</list> </list>
</property> </property>
<!--The search filters which can be used on the discovery search page --> <!--The search filters which can be used on the discovery search page -->
<property name="searchFilters"> <property name="searchFilters">
<list> <list>
<ref bean="searchFilterObjectNamedType" /> <ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterType" /> <ref bean="searchFilterType" />
<ref bean="searchFilterIssued" /> <ref bean="searchFilterIssued" />
<ref bean="searchFilterSubmitter" /> <ref bean="searchFilterSubmitter" />
</list> </list>
</property> </property>
<!--The sort filters for the discovery search--> <!--The sort filters for the discovery search-->
<property name="searchSortConfiguration"> <property name="searchSortConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration"> <bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
@@ -414,14 +413,14 @@
</property> </property>
</bean> </bean>
</property> </property>
<!--Any default filter queries, these filter queries will be used for all <!--Any default filter queries, these filter queries will be used for all
queries done by discovery for this configuration --> queries done by discovery for this configuration -->
<property name="defaultFilterQueries"> <property name="defaultFilterQueries">
<list> <list>
<!--Only find PoolTask and ClaimedTask --> <!--Only find PoolTask and ClaimedTask -->
<value>search.resourcetype:[10 TO 11]</value> <value>search.resourcetype:[10 TO 11]</value>
</list> </list>
</property> </property>
<!--Default result per page --> <!--Default result per page -->
<property name="defaultRpp" value="10" /> <property name="defaultRpp" value="10" />
<property name="hitHighlightingConfiguration"> <property name="hitHighlightingConfiguration">
@@ -479,70 +478,70 @@
</bean> </bean>
<bean id="tagCloudConfiguration" class="org.dspace.discovery.configuration.TagCloudConfiguration"> <bean id="tagCloudConfiguration" class="org.dspace.discovery.configuration.TagCloudConfiguration">
<!-- Should display the score of each tag next to it? Default: false --> <!-- Should display the score of each tag next to it? Default: false -->
<!-- <property name="displayScore" value="true"/> --> <!-- <property name="displayScore" value="true"/> -->
<!-- Should display the tag as center aligned in the page or left aligned? Possible values: true | false. Default: true --> <!-- Should display the tag as center aligned in the page or left aligned? Possible values: true | false. Default: true -->
<!-- <property name="shouldCenter" value="true"/> --> <!-- <property name="shouldCenter" value="true"/> -->
<!-- How many tags will be shown. Value -1 means all of them. Default: -1 --> <!-- How many tags will be shown. Value -1 means all of them. Default: -1 -->
<!--<property name="totalTags" value="-1"/> --> <!--<property name="totalTags" value="-1"/> -->
<!-- The letter case of the tags. <!-- The letter case of the tags.
Possible values: Case.LOWER | Case.UPPER | Case.CAPITALIZATION | Case.PRESERVE_CASE | Case.CASE_SENSITIVE Possible values: Case.LOWER | Case.UPPER | Case.CAPITALIZATION | Case.PRESERVE_CASE | Case.CASE_SENSITIVE
Default: Case.PRESERVE_CASE --> Default: Case.PRESERVE_CASE -->
<!--<property name="cloudCase" value="Case.PRESERVE_CASE"/> --> <!--<property name="cloudCase" value="Case.PRESERVE_CASE"/> -->
<!-- If the 3 colors of the tag cloud should be independent of score (random=yes) or based on the score. Possible values: true | false . Default: true--> <!-- If the 3 colors of the tag cloud should be independent of score (random=yes) or based on the score. Possible values: true | false . Default: true-->
<!-- <property name="randomColors" value="true"/> --> <!-- <property name="randomColors" value="true"/> -->
<!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 1.1 --> <!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 1.1 -->
<!-- <property name="fontFrom" value="1.1"/>--> <!-- <property name="fontFrom" value="1.1"/>-->
<!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 3.2 --> <!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 3.2 -->
<!-- <property name="fontTo" value="3.2"/>--> <!-- <property name="fontTo" value="3.2"/>-->
<!-- The score that tags with lower than that will not appear in the rag cloud. Possible values: any integer from 1 to infinity. Default: 0 --> <!-- The score that tags with lower than that will not appear in the rag cloud. Possible values: any integer from 1 to infinity. Default: 0 -->
<!-- <property name="cuttingLevel" value="0"/>--> <!-- <property name="cuttingLevel" value="0"/>-->
<!-- The ordering of the tags (based either on the name or the score of the tag) <!-- The ordering of the tags (based either on the name or the score of the tag)
Possible values: Tag.NameComparatorAsc | Tag.NameComparatorDesc | Tag.ScoreComparatorAsc | Tag.ScoreComparatorDesc Possible values: Tag.NameComparatorAsc | Tag.NameComparatorDesc | Tag.ScoreComparatorAsc | Tag.ScoreComparatorDesc
Default: Tag.NameComparatorAsc --> Default: Tag.NameComparatorAsc -->
<!-- <property name="ordering" value="Tag.NameComparatorAsc"/>--> <!-- <property name="ordering" value="Tag.NameComparatorAsc"/>-->
</bean> </bean>
<!-- The tag cloud parameters for the tag clouds that appear in the browse pages --> <!-- The tag cloud parameters for the tag clouds that appear in the browse pages -->
<bean id="browseTagCloudConfiguration" class="org.dspace.discovery.configuration.TagCloudConfiguration"> <bean id="browseTagCloudConfiguration" class="org.dspace.discovery.configuration.TagCloudConfiguration">
<!-- Should display the score of each tag next to it? Default: false --> <!-- Should display the score of each tag next to it? Default: false -->
<!-- <property name="displayScore" value="true"/> --> <!-- <property name="displayScore" value="true"/> -->
<!-- Should display the tag as center aligned in the page or left aligned? Possible values: true | false. Default: true --> <!-- Should display the tag as center aligned in the page or left aligned? Possible values: true | false. Default: true -->
<!-- <property name="shouldCenter" value="true"/> --> <!-- <property name="shouldCenter" value="true"/> -->
<!-- How many tags will be shown. Value -1 means all of them. Default: -1 --> <!-- How many tags will be shown. Value -1 means all of them. Default: -1 -->
<!--<property name="totalTags" value="-1"/> --> <!--<property name="totalTags" value="-1"/> -->
<!-- The letter case of the tags. <!-- The letter case of the tags.
Possible values: Case.LOWER | Case.UPPER | Case.CAPITALIZATION | Case.PRESERVE_CASE | Case.CASE_SENSITIVE Possible values: Case.LOWER | Case.UPPER | Case.CAPITALIZATION | Case.PRESERVE_CASE | Case.CASE_SENSITIVE
Default: Case.PRESERVE_CASE --> Default: Case.PRESERVE_CASE -->
<!--<property name="cloudCase" value="Case.PRESERVE_CASE"/> --> <!--<property name="cloudCase" value="Case.PRESERVE_CASE"/> -->
<!-- If the 3 colors of the tag cloud should be independent of score (random=yes) or based on the score. Possible values: true | false . Default: true--> <!-- If the 3 colors of the tag cloud should be independent of score (random=yes) or based on the score. Possible values: true | false . Default: true-->
<!-- <property name="randomColors" value="true"/> --> <!-- <property name="randomColors" value="true"/> -->
<!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 1.1 --> <!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 1.1 -->
<!-- <property name="fontFrom" value="1.1"/>--> <!-- <property name="fontFrom" value="1.1"/>-->
<!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 3.2 --> <!-- The font size (in em) for the tag with the lowest score. Possible values: any decimal. Default: 3.2 -->
<!-- <property name="fontTo" value="3.2"/>--> <!-- <property name="fontTo" value="3.2"/>-->
<!-- The tags with score lower than this will not appear in the tag cloud. Possible values: any integer from 1 to infinity. Default: 0 --> <!-- The tags with score lower than this will not appear in the tag cloud. Possible values: any integer from 1 to infinity. Default: 0 -->
<!-- <property name="cuttingLevel" value="0"/>--> <!-- <property name="cuttingLevel" value="0"/>-->
<!-- The ordering of the tags (based either on the name or the score of the tag) <!-- The ordering of the tags (based either on the name or the score of the tag)
Possible values: Tag.NameComparatorAsc | Tag.NameComparatorDesc | Tag.ScoreComparatorAsc | Tag.ScoreComparatorDesc Possible values: Tag.NameComparatorAsc | Tag.NameComparatorDesc | Tag.ScoreComparatorAsc | Tag.ScoreComparatorDesc
Default: Tag.NameComparatorAsc --> Default: Tag.NameComparatorAsc -->
<!-- <property name="ordering" value="Tag.NameComparatorAsc"/>--> <!-- <property name="ordering" value="Tag.NameComparatorAsc"/>-->
</bean> </bean>
<!--Search filter configuration beans--> <!--Search filter configuration beans-->
@@ -633,46 +632,46 @@
</property> </property>
</bean> </bean>
<bean id="searchFilterType" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"> <bean id="searchFilterType" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="itemtype" /> <property name="indexFieldName" value="itemtype" />
<property name="metadataFields"> <property name="metadataFields">
<list> <list>
<value>dc.type</value> <value>dc.type</value>
</list> </list>
</property> </property>
</bean> </bean>
<bean id="searchFilterObjectType" <bean id="searchFilterObjectType"
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"> class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="resourcetype" /> <property name="indexFieldName" value="resourcetype" />
<property name="metadataFields"> <property name="metadataFields">
<list> <list>
<value>placeholder.placeholder.placeholder</value> <value>placeholder.placeholder.placeholder</value>
</list> </list>
</property> </property>
</bean> </bean>
<bean id="searchFilterObjectNamedType" <bean id="searchFilterObjectNamedType"
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"> class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="namedresourcetype" /> <property name="indexFieldName" value="namedresourcetype" />
<property name="metadataFields"> <property name="metadataFields">
<list> <list>
<value>placeholder.placeholder.placeholder</value> <value>placeholder.placeholder.placeholder</value>
</list> </list>
</property> </property>
</bean> </bean>
<!-- Used only to READ "submitter" facets (managed programmatically at SolrServiceImpl) -->
<bean id="searchFilterSubmitter"
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="submitter" />
<property name="metadataFields">
<list>
<value>placeholder.placeholder.placeholder</value>
</list>
</property>
</bean>
<!-- Used only to READ "submitter" facets (managed programmatically at SolrServiceImpl) -->
<bean id="searchFilterSubmitter"
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="submitter" />
<property name="metadataFields">
<list>
<value>placeholder.placeholder.placeholder</value>
</list>
</property>
</bean>
<!--Sort properties--> <!--Sort properties-->
<bean id="sortTitle" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration"> <bean id="sortTitle" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
<property name="metadataField" value="dc.title"/> <property name="metadataField" value="dc.title"/>