All Versions
- DSpace 7.x (Current Release)
- DSpace 8.x (Unreleased)
- DSpace 6.x (EOL)
- DSpace 5.x (EOL)
- More Versions...
...
In a faceted search, a user can modify the list of displayed search results by specifying additional "filters" that will be applied on the list of search results. In DSpace, a filter is a contain condition applied to specific facets. In the example below, a user started with the search term "approachhealth", which yielded 15 500 results. By After applying the filter "economicspublic" on the facet "Subject". After applying this filter, only 6 227 results remain. Each time a user selects a sidebar facet it will be added as a filter. Active filters can be altered or removed in the 'filters' section of the search interface.
Wiki Markup |
---|
Another example: would beUsing the standard search operation, a user would search for something like \[*wetland + "dc.author=Mitsch, William J" + dc.subject="water quality"* \]. With filtered search, athey user can start by searching for \[*wetland* \], and then filter the results by the other attributes, author and subject. |
config/modules/discovery.cfg
and config/spring/discovery/spring-dspace-addon-discovery-configuration-services.xml
Wiki Markup |
---|
As with any upgrade procedure, it is highly recommend that you backup your existing data thoroughly. Although upgrades in versions of Solr/Lucene do tend to be forwards compatible for the data stored in the Lucene index, it is always a best practice to backup your {{\[dspace-install-dir\]/solr/statistics}} cores to assure no data is lost. |
config/xmlui.xconf
SearchArtifacts
Discovery
Code Block | ||||
---|---|---|---|---|
| ||||
<xmlui> <aspects> <!-- @deprecated: the Artifact Browser has been devided into ViewArtifacts, BrowseArtifacts, SearchArtifacts <aspect name="Artifact Browser" path="resource://aspects/ArtifactBrowser/" /> --> <aspect name="Displaying Artifacts" path="resource://aspects/ViewArtifacts/" /> <aspect name="Browsing Artifacts" path="resource://aspects/BrowseArtifacts/" /> <!--<aspect name="Searching Artifacts" path="resource://aspects/SearchArtifacts/" />--> <aspect name="Administration" path="resource://aspects/Administrative/" /> <aspect name="E-Person" path="resource://aspects/EPerson/" /> <aspect name="Submission and Workflow" path="resource://aspects/Submission/" /> <aspect name="Statistics" path="resource://aspects/Statistics/" /> <!-- To enable Discovery, uncomment this Aspect that will enable it within your existing XMLUI Also make sure to comment the SearchArtifacts aspect as leaving it on together with discovery will cause UI overlap issues--> <aspect name="Discovery" path="resource://aspects/Discovery/" /> <!-- This aspect tests the various possible DRI features, it helps a theme developer create themes --> <!-- <aspect name="XML Tests" path="resource://aspects/XMLTest/"/> --> </aspects> |
Code Block |
---|
# default synchronous dispatcher (same behavior as traditional DSpace) event.dispatcher.default.class = org.dspace.event.BasicDispatcher #event.dispatcher.default.consumers = search, browse, eperson, harvester event.dispatcher.default.consumers = search, browse, discovery, eperson, harvester |
Code Block |
---|
#Put the recent submissions count to 0 so that discovery can use it's recent submissions, # not doing this when discovery is enabled will cause UI overlap issues #How many recent submissions should be displayed at any one time #recent.submissions.count = 5 recent.submissions.count = 0 |
Code Block |
---|
##### Search Indexing ##### solr.search.server = http://localhost/solr/search |
Code Block |
---|
./bin/dspace update-discovery-index |
Panel |
---|
NOTE: This step may take some time if you have a large number of items in your repository. |
...
Wiki Markup |
---|
General settings: The *{{discovery.cfg*}} file located in the {{\[dspace-install-dir\]/config/modules directory}}. |
Wiki Markup |
---|
User Interface Configuration: The *{{spring-dspace-addon-discovery-configuration-services.xml*}} file is located in {{\[dspace-install-dir\]/config/spring/discovery/}} directory. |
config/modules/discovery.cfg
)Wiki Markup |
---|
The {{discovery.cfg}} file is located in the {{\[dspace-install-dir\]/config/modules}} directory and contains following properties: |
Property: | search.server | ||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6f081191-68b1-44dd-8f23-b81daeb0d32e"><ac:plain-text-body><![CDATA[ | Example Value: | | ]]></ac:plain-text-body></ac:structured-macro> |
Informational Note: | Discovery relies on a SOLR index for storage and retrieval of its information. This parameter determines the location of the SOLR index. | ||
Property: | index.ignore | ||
Example Value: | | ||
Informational Note: | By default, Discovery will include all of the DSpace metadata in its search index. In cases where specific metadata is confidential, repository managers can include those fields by adding them to this comma separated list. |
config/spring/spring-dspace-addon-discovery-configuration-services.xml
)Wiki Markup |
---|
The {{spring-dspace-addon-discovery-configuration-services.xml}} file is located in the {{\[dspace-install-dir\]/config/spring}} directory. |
Because this This file is in XML format, you should be familiar with XML before editing this file. The configurations are organized together in beans, depending on the purpose these properties are used for.
This purpose can be derived from the class of the beans. Here's a short summaries summary of classes you will encounter throughout the file and what the corresponding properties in the bean are used for.
...
Class: | DiscoveryConfigurationService |
Purpose: | Defines the mapping between separate Discovery configurations and individual collections/communities |
Default: | All communities, collections and the homepage (key=default) are mapped to defaultConfiguration |
Class: | DiscoveryConfiguration |
Purpose: | Groups configurations for sidebar facets, search filters, search sort options and recent submissions |
Default: | There is one configuration by default called defaultConfiguration |
Class: | DiscoverySearchFilter |
Purpose: | Defines that specific metadata fields should be enabled as a search filter |
Default: | dc.title, dc.contributor.author, dc.creator, dc.subject.* and dc.date.issued are defined as search filters |
Class: | DiscoverySearchFilterFacet DiscoverySidebarFacetConfiguration |
Purpose: | Defines which metadata fields should be offered as a contextual sidebar browse option options, each of these facets has also got to be a search filter |
Default: | dc.contributor.author, dc.creator, dc.subject.* and dc.date.issued |
Class: | HierarchicalSidebarFacetConfiguration |
Purpose: | Defines which metadata fields contain hierarchical data and should be offered as a contextual sidebar option |
Class: | DiscoverySortConfiguration |
Purpose: | Further specifies the sort options to which a DiscoveryConfiguration refers |
Default: | dc.title and dc.date.issued are defined as alternatives for sorting, other than Relevance (hard coded) |
Class: |
DiscoveryHitHighlightingConfiguration | |
Purpose: | Defines which metadata fields can contain hit highlighting & search snippets |
Default: | dc.title, dc.contributor.author, dc.subject, dc.description.abstract & full text from text files. |
In addition to the In addition to the summarized descriptions of the default values, following details help you to better understand these defaults. If you haven't yet, download the configuration file and review it together with the following parameters.
The file contains one default configuration that defines following sidebar facets, search filters, sort fields and recent submissions display:
Many of the properties contain lists that use references to point to the configuration elements. Many of the properties contain lists which use references to point to the configuration elements. This way a certain configuration type can be used in multiple discovery configurations so there is no need to duplicate thesethem.
...
This section explains the properties of an individual SidebarFacet, like SidebarFacetAuthor, SidebarFacetSubject and SidebarFacetDateIssued from the default configuration. In order to create custom SidebarFacets, you can either modify specific properties of those that already exist or create a totally new one from scratch.
Here's what the SidebarFacetAuthor looks like:
for search filters & sidebar facets. Each sidebar facet must occur in the reference list of the search filters. Below is an example configuration of a search filter that is not used as a sidebar facet.
Code Block | ||
---|---|---|
| ||
<bean id="sidebarFacetAuthorsearchFilterTitle" class="org.dspace.discovery.configuration.SidebarFacetConfigurationDiscoverySearchFilter"> <property name="indexFieldName" value="authortitle"/> <property name="metadataFields"> <list> <value>dc.contributor.author<title</value> </list> </property> </bean> |
The id & class attributes are mandatory for this type of bean. The properties that it contains are discussed below.
Sidebar facets extend the search filter and add some extra properties to it, below is an example of a search filter that is also used as a sidebar facet.
Code Block | ||
---|---|---|
| ||
<bean id="searchFilterAuthor" class="org.dspace.discovery.configuration.SidebarFacetConfiguration" <value>dc.creator</value> </list> </property> <property name="facetLimit" value="10"/> <property name="sortOrderindexFieldName" value="COUNTauthor"/> <property name="type" value="text"/> </bean> |
The id & class attributes are mandatory for this type of bean. The properties that it contains are discussed below.
...
metadataFields">
<list>
<value>dc.contributor.author</value>
<value>dc.creator</value>
</list>
</property>
<property name="facetLimit" value="10"/>
<property name="sortOrder" value="COUNT"/>
<property name="type" value="text"/>
</bean> |
Note that the class has changed from DiscoverySearchFilter to SidebarFacetConfiguration this is needed to support the extra properties
...
.
This section explains the properties of an individual SearchFilter, like searchFilterTitle, searchFilterAuthor, searchFilterSubject and searchFilterIssued from the default configuration. In order to create custom Search Filters, you can either modify specific properties of those that already exist or create a totally new one from scratch.
Here's what the searchFilterAuthor looks like:
Hierarchical facets further extend the sidebar facet concept, each metadata field is composed of multiple nodes which are combined by a certain splitter. e.g. group::sub-group::sub-sub-group
. The sidebar will only display the top level facets, when clicking on view more all the facet options will be displayed.
Code Block | ||
---|---|---|
| ||
<bean id="searchFilterSubject" class="org.dspace.discovery.configuration.HierarchicalSidebarFacetConfiguration | ||
Code Block | ||
| ||
<bean id="searchFilterAuthor" class="org.dspace.discovery.configuration.DiscoverySearchFilter"> <property name="indexFieldName" value="authorsubject"/> <property name="metadataFields"> <list> <value>dc.contributor.author<subject</value> <value>dc.creator</value> </list> </property> <property name="fullAutoCompletesortOrder" value="COUNT"/> <property name="splitter" value="true::"/> <property name="typeskipFirstNodeLevel" value="textfalse"/> </bean> |
The id & class attributes are mandatory for this type of bean. The properties that it contains are discussed below.
This section explains the properties of an individual SortConfiguration, like sortTitle and sortDateIssued from the default configuration. In order to create custom sort options, you can either modify specific properties of those that already exist or create a totally new one from scratch.
Here's what the sortTitle SortConfiguration looks like:
|
Note that the class has changed from SidebarFacetConfiguration to HierarchicalSidebarFacetConfiguration this is needed to support the extra properties.
This section explains the properties of an individual SortConfiguration, like sortTitle and sortDateIssued from the default configuration. In order to create custom sort options, you can either modify specific properties of those that already exist or create a totally new one from scratch.
Here's what the sortTitle SortConfiguration looks like:
Code Block | ||
---|---|---|
| ||
<bean | ||
Code Block | ||
| ||
<bean id="sortTitle" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
<property name="metadataField" value="dc.title"/>
<property name="type" value="text"/>
</bean> |
...
Below is an example of how one of these lists can be configured. It's important that each of the bean references corresponds with to the exact name of the earlier defined Facetsfacets, filters or sort options.
Warning |
---|
Each sidebar facet must also occur in the list of the search filters. |
Code Block | ||
---|---|---|
| ||
<property name="sidebarFacets"> <list> <ref bean="sidebarFacetAuthor" /> <ref bean="sidebarFacetSubject" /> <ref bean="sidebarFacetDateIssued" /> </list> </property> |
...
Code Block | ||
---|---|---|
| ||
<property name="recentSubmissionConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoveryRecentSubmissionsConfiguration">
<property name="metadataSortField" value="dc.date.accessioned"/>
<property name="type" value="date"/>
<property name="max" value="5"/>
</bean>
</property>
|
The property name & the bean class are mandatory. The property field names are discusses below.
...
>
</bean>
</property>
|
The property name & the bean class are mandatory. The property field names are discusses below.
The hit highlighting configuration element contains all the settings to display search snippets & enable hit highlighting.
Warning |
---|
Changes made to the configuration will not automatically be displayed in the user interface. By default only the following fields are displayed: dc.title, dc.contributor.author, dc.creator, dc.contributor, dc.date.issued, dc.publisher, dc.description.abstract and fulltext. If additional fields are required look for the "itemSummaryList" template. |
Below is an example configuration of the hit highlighting.
Code Block | ||
---|---|---|
| ||
<property name="hitHighlightingConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightingConfiguration">
<property name="metadataFields">
<list>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="dc.title"/>
<property name="snippets" value="5"/>
</bean>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="dc.contributor.author"/>
<property name="snippets" value="5"/>
</bean>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="dc.subject"/>
<property name="snippets" value="5"/>
</bean>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="dc.description.abstract"/>
<property name="maxSize" value="250"/>
<property name="snippets" value="2"/>
</bean>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="fulltext"/>
<property name="maxSize" value="250"/>
<property name="snippets" value="2"/>
</bean>
</list>
</property>
</bean>
</property> |
The property name & the bean class are mandatory. The property field names are:
*
if all the metadata fields should be highlighted).The org.dspace.discovery.DiscoveryQuery object has a setter & getter for the hit highlighting configuration configured in the discovery configuration. If this configuration is given the resolveToSolrQuery method located in the org.dspace.discovery.SolrServiceImpl class will use the standard solr highlighting feature (http://wiki.apache.org/solr/HighlightingParameters). The org.dspace.discovery.DiscoverResult class has a method to set the highlighted fields for each object & field.
Wiki Markup |
---|
The rendering of search results is no longer handled by the mets format but uses a special type of list named "TYPE_DSO_LIST". Each metadata field (& fulltext if configured) is added in the DRI and IF the field contains hit higlighting the java code will split up the string & add _DRI highlights_ to the list. The xsl for the themes also contains special rendering xsl for the DRI, for Mirage the changes have been located in the _discovery.xsl_ file. For themes using the old structural.xsl look for the template matching "_dri:list\[@type='dsolist'\]_". |
The 'more like this'-configuration element contains all the settings for displaying the related items on an item display page.
Below is an example of the more like this configuration.
Code Block | ||
---|---|---|
| ||
<property name="moreLikeThisConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoveryMoreLikeThisConfiguration">
<property name="similarityMetadataFields">
<list>
<value>dc.contributor.author</value>
<value>dc.creator</value>
<value>dc.subject</value>
</list>
</property>
<!--The minimum number of matching terms accross the metadata fields above before an item is found as related -->
<property name="minTermFrequency" value="5"/>
<!--The maximum number of related items displayed-->
<property name="max" value="3"/>
</bean>
</property> |
The property name & the bean class are mandatory. The property field names are discusses below.
The org.dspace.discovery.SearchService object has received a getRelatedItems() method. This method requires an item & the more-like-this configuration bean from above. This method is implemented in the org.dspace.discovery.SolrServiceImpl which uses the item as a query & uses the default Solr parameters for more-like-this to pass the bean configuration to solr (http://wiki.apache.org/solr/MoreLikeThis). The result will be a list of items or if none found an empty list. The rendering of this list is handled in the org.dspace.app.xmlui.aspect.discovery.RelatedItems class.
Wiki Markup |
---|
The items returned by discovery are all the items the user logged in has access to. So the results may differ if you are logged in. This feature can be switched off it isn't requested by going to the \[dspace.dir\]/config/spring/discovery/spring-dspace-addon-discovery-solr-plugin-services.xml file & commenting out the bean & the alias shown below. |
Code Block | ||
---|---|---|
| ||
<bean class="org.dspace.discovery.SolrServiceResourceRestrictionPlugin" id="solrServiceResourceIndexPlugin"/>
<alias name="solrServiceResourceIndexPlugin" alias="org.dspace.discovery.SolrServiceResourceRestrictionPlugin"/> |
The DSpaceObject class has an updateLastModified() method which will be triggered each time an authorization policy changes. This method is only implemented in the item class where the last_modified timestamp will be updated and a modify event will be fired. By doing this we ensure that the discovery consumer is called and the item is reindexed. Since this feature can be switched off a separate plugin has been created: the SolrServiceResourceRestrictionPlugin. Whenever we reindex a DSpace object all the read rights will be stored in the read field. We make a distinction between groups and users by adding a 'g' prefix for groups and the 'e' prefix for epersons.
When searching in discovery all the groups the user belongs to will be added as a filter query as well as the users identifier. If the user is an admin all items will be returned since an admin has read rights on everything
...
.
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5a9547761dabd843-68a93aab-478e47a5-bf799b63-e2c3a205db9c1d886d89ec06"><ac:plain-text-body><![CDATA[ | Command used: | | ]]></ac:plain-text-body></ac:structured-macro> |
Java class: | org.dspace.discovery.IndexClient | ||
Arguments (short and long forms): | Description | ||
| called without any options, will update/clean an existing index | ||
| (re)build index, wiping out current one if it exists | ||
| clean existing index removing any documents that no longer exist in the db | ||
| if updating existing index, force each handle to be reindexed even if uptodate | ||
| print this help message | ||
| optimize search core | ||
| remove an Item, Collection or Community from index based on its handle |
...
Discovery is built as an application layer on top of the Open Source Enterprise Search Server SOLR. ThereforeTherefor, SOLR configuration can be applied to the SOLR cores that are shipped with DSpace.
The DSpace SOLR instance itself now runs two cores. One for collection DSpace Solr based "statistics", the other for Discovery Solr based "search".
...