SUNScholar/Discovery/1.8.X

From Libopedia
Jump to navigation Jump to search
Back to Search Indexes

Step 1

Edit the solr search URL in the discovery service setup file.

nano $HOME/source/dspace/config/modules/discovery.cfg

Make sure the solr URL is as follows by removing port 8080. See example below.

#---------------------------------------------------------------#
#-----------------DISCOVERY CONFIGURATIONS----------------------#
#---------------------------------------------------------------#
# Configuration properties used solely by the Discovery         #
# faceted-search system.                                        #
#---------------------------------------------------------------#
##### Search Indexing #####
search.server = http://localhost/solr/search

#Char used to ensure that the sidebar facets are case insensitive
#solr.facets.split.char=|||

#All metadata fields that will not end up in the index, this is a comma separated list
index.ignore=dc.description.provenance

NANO Editor Help
CTL+O = Save the file and then press Enter
CTL+X = Exit "nano"
CTL+K = Delete line
CTL+U = Undelete line
CTL+W = Search for %%string%%
CTL+\ = Search for %%string%% and replace with $$string$$
CTL+C = Show line numbers

More info = http://en.wikipedia.org/wiki/Nano_(text_editor)


Step 2

Please refer to the official DSpace documentation to enable Discovery.

Step 3

Type the following to rebuild the discovery index.

$HOME/bin/dspace update-discovery-index -b

Step 4 - Custom Configuration (Optional)

Customise the discovery search facets by modifying the following file:

nano $HOME/source/dspace/config/spring/discovery/spring-dspace-addon-discovery-configuration-services.xml
Remember to rebuild the index afterwards.

Author as "advisor" has been added and number of facets displayed has been amended to the example below.

<?xml version="1.0" encoding="UTF-8"?>
<!--

    The contents of this file are subject to the license and copyright
    detailed in the LICENSE and NOTICE files at the root of the source
    tree and available online at

    http://www.dspace.org/license/

-->
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd"
    default-autowire-candidates="*Service,*DAO,javax.sql.DataSource">

    <context:annotation-config /> <!-- allows us to use spring annotations in beans -->

    <!--Bean that is used for mapping communities/collections to certain discovery configurations.-->
    <bean id="org.dspace.discovery.configuration.DiscoveryConfigurationService" class="org.dspace.discovery.configuration.DiscoveryConfigurationService">
        <property name="map">
            <map>
                <!--The map containing all the settings,
                    the key is used to refer to the page (the "site" or a community/collection handle)
                    the value-ref is a reference to an identifier of the DiscoveryConfiguration format
                    -->
                <!--The default entry, DO NOT REMOVE the system requires this-->
               <entry key="default" value-ref="defaultConfiguration" />

               <!--Use site to override the default configuration for the home page & default discovery page-->
               <!--<entry key="site" value-ref="defaultConfiguration" />-->
               <!--<entry key="123456789/7621" value-ref="defaultConfiguration"/>-->
            </map>
        </property>
    </bean>

    <!--The default configuration settings for discovery-->
    <bean id="defaultConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype">
        <!--Which sidebar facets are to be displayed-->
        <property name="sidebarFacets">
            <list>
                <ref bean="sidebarFacetAdvisor" />
                <ref bean="sidebarFacetAuthor" />
                <ref bean="sidebarFacetSubject" />
                <ref bean="sidebarFacetDateIssued" />
            </list>
        </property>
        <!--The search filters which can be used on the discovery search page-->
        <property name="searchFilters">
            <list>
                <ref bean="searchFilterTitle" />
                <ref bean="searchFilterAdvisor" />
                <ref bean="searchFilterAuthor" />
                <ref bean="searchFilterSubject" />
                <ref bean="searchFilterIssued" />
                <ref bean="searchFilterType" />
                <ref bean="searchFilterProvenance" />
            </list>
        </property>
        <!--The sort filters for the discovery search-->
        <property name="searchSortConfiguration">
            <bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
                <property name="defaultSort" ref="sortDateIssued"/>
                <!--DefaultSortOrder can either be desc or asc (desc is default)-->
                <property name="defaultSortOrder" value="desc"/>
                <property name="sortFields">
                    <list>
                        <ref bean="sortTitle" />
                        <ref bean="sortDateIssued" />
                    </list>
                </property>
            </bean>
        </property>
        <!--Any default filter queries, these filter queries will be used for all queries done by discovery for this configuration-->
        <!--<property name="defaultFilterQueries">-->
            <!--<list>-->
                <!--Only find items-->
                <!--<value>search.resourcetype:2</value>-->
            <!--</list>-->
        <!--</property>-->
        <!--The configuration for the recent submissions-->
        <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="15"/>
            </bean>
        </property>
    </bean>



    <!--Search filter configuration beans-->
    <bean id="searchFilterTitle" class="org.dspace.discovery.configuration.DiscoverySearchFilter">
        <property name="indexFieldName" value="title"/>
        <property name="metadataFields">
            <list>
                <value>dc.title</value>
            </list>
        </property>
        <property name="fullAutoComplete" value="false"/>
    </bean>

    <bean id="searchFilterAdvisor" class="org.dspace.discovery.configuration.DiscoverySearchFilter">
        <property name="indexFieldName" value="advisor"/>
        <property name="metadataFields">
            <list>
                <value>dc.contributor.advisor</value>
            </list>
        </property>
        <property name="fullAutoComplete" value="true"/>
    </bean>

    <bean id="searchFilterAuthor" class="org.dspace.discovery.configuration.DiscoverySearchFilter">
        <property name="indexFieldName" value="author"/>
        <property name="metadataFields">
            <list>
                <value>dc.contributor.author</value>
            </list>
        </property>
        <property name="fullAutoComplete" value="true"/>
    </bean>

    <bean id="searchFilterSubject" class="org.dspace.discovery.configuration.DiscoverySearchFilter">
        <property name="indexFieldName" value="subject"/>
        <property name="metadataFields">
            <list>
                <value>dc.subject.*</value>
            </list>
        </property>
        <property name="fullAutoComplete" value="true"/>
    </bean>

    <bean id="searchFilterIssued" class="org.dspace.discovery.configuration.DiscoverySearchFilter">
        <property name="indexFieldName" value="dateIssued"/>
        <property name="metadataFields">
            <list>
                <value>dc.date.issued</value>
            </list>
        </property>
        <property name="type" value="date"/>
        <property name="fullAutoComplete" value="false"/>
    </bean>

    <bean id="searchFilterType" class="org.dspace.discovery.configuration.DiscoverySearchFilter">
        <property name="indexFieldName" value="type"/>
        <property name="metadataFields">
            <list>
                <value>dc.type</value>
            </list>
        </property>
        <property name="fullAutoComplete" value="true"/>
    </bean>

    <bean id="searchFilterProvenance" class="org.dspace.discovery.configuration.DiscoverySearchFilter">
        <property name="indexFieldName" value="provenance"/>
        <property name="metadataFields">
            <list>
                <value>dc.description.provenance</value>
            </list>
        </property>
        <property name="fullAutoComplete" value="true"/>
    </bean>

    <!--Sidebar facet configuration beans-->
    <bean id="sidebarFacetAdvisor" class="org.dspace.discovery.configuration.SidebarFacetConfiguration">
        <property name="indexFieldName" value="advisor"/>
        <property name="metadataFields">
            <list>
                <value>dc.contributor.advisor</value>
            </list>
        </property>
        <property name="facetLimit" value="30"/>
        <property name="sortOrder" value="COUNT"/>
    </bean>

    <bean id="sidebarFacetAuthor" class="org.dspace.discovery.configuration.SidebarFacetConfiguration">
        <property name="indexFieldName" value="author"/>
        <property name="metadataFields">
            <list>
                <value>dc.contributor.author</value>
            </list>
        </property>
        <property name="facetLimit" value="30"/>
        <property name="sortOrder" value="COUNT"/>
    </bean>

    <bean id="sidebarFacetSubject" class="org.dspace.discovery.configuration.SidebarFacetConfiguration">
        <property name="indexFieldName" value="subject"/>
        <property name="metadataFields">
            <list>
                <value>dc.subject.*</value>
            </list>
        </property>
        <property name="facetLimit" value="30"/>
        <property name="sortOrder" value="COUNT"/>
    </bean>

    <bean id="sidebarFacetDateIssued" class="org.dspace.discovery.configuration.SidebarFacetConfiguration">
        <property name="indexFieldName" value="dateIssued"/>
        <property name="metadataFields">
            <list>
                <value>dc.date.issued</value>
            </list>
        </property>
        <property name="type" value="date"/>
        <property name="sortOrder" value="VALUE"/>
    </bean>


    <!--Sort properties-->
    <bean id="sortTitle" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
        <property name="metadataField" value="dc.title"/>
    </bean>

    <bean id="sortDateIssued" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
        <property name="metadataField" value="dc.date.issued"/>
        <property name="type" value="date"/>
    </bean>
</beans>

Step 5 - Update messages.xml file with custom texts (Optional, see step 4 above)

It may be required to update the messages.xml file with any new indexes defined. See example below.

Add the following to the bottom of the file. Also see: Language modification

<!-- Added by H Gibson -->

       <!-- Title Messages -->
        <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.column_heading">Title</message>
        <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.title">Browsing by Title</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.title">Browsing by Title</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.sort_by.title">title</message>
	<message key="xmlui.ArtifactBrowser.AbstractSearch.sort_by.title">title</message>

       <!-- Author Messages -->
        <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.author.column_heading">Author</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.author">Author</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.author">Browsing by Author</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.sort_by.author">author</message>
	<message key="xmlui.ArtifactBrowser.AbstractSearch.sort_by.author">author</message>

       <!-- Advisor Messages -->
        <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.advisor.column_heading">Advisor</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.advisor">Advisor</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.advisor">Browsing by Advisor</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.sort_by.advisor">advisor</message>
	<message key="xmlui.ArtifactBrowser.AbstractSearch.sort_by.advisor">advisor</message>
        <message key="xmlui.ArtifactBrowser.Navigation.browse_advisor">By Advisor</message>
        <message key="xmlui.ArtifactBrowser.SimpleSearch.filter.dc.contributor.advisor">Advisor</message>
        <message key="xmlui.ArtifactBrowser.SimpleSearch.filter.advisor">Advisor</message>

       <!-- Issue Date Messages -->
        <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.dateissued.column_heading">Issue Date</message>
        <message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.dateissued">Browsing by Issue Date</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.dateissued">Browsing by Issue Date</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.sort_by.issuedate">issuedate</message>
	<message key="xmlui.ArtifactBrowser.AbstractSearch.sort_by.issuedate">issuedate</message>
	<message key="xmlui.ArtifactBrowser.AdvancedSearch.type_date">Date</message>
	<message key="xmlui.ArtifactBrowser.AdvancedSearch.type_issuedate">Issue Date</message>

       <!-- Subject Messages -->
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.subject">Subject</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.subject">Browsing by Subject</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.sort_by.subject">subject</message>
	<message key="xmlui.ArtifactBrowser.AbstractSearch.sort_by.subject">subject</message>

       <!-- Type Messages -->
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.type.column_heading">Type</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata.type">Type</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata.type">Browsing by Type</message>
	<message key="xmlui.ArtifactBrowser.ConfigurableBrowse.sort_by.type">type</message>
	<message key="xmlui.ArtifactBrowser.AbstractSearch.sort_by.type">type</message>
        <message key="xmlui.ArtifactBrowser.Navigation.browse_type">By Type</message>
	<message key="xmlui.ArtifactBrowser.AdvancedSearch.type_type">Type</message>	
	<message key="xmlui.ArtifactBrowser.SimpleSearch.filter.dc.type">Type</message>
	<message key="xmlui.ArtifactBrowser.SimpleSearch.filter.type">Type</message>
	<message key="xmlui.ArtifactBrowser.SimpleSearch.filter.type_filter">Type</message>

       <!-- Provenance Messages -->
	<message key="xmlui.ArtifactBrowser.AdvancedSearch.type_provenance">Provenance</message>
	<message key="xmlui.ArtifactBrowser.SimpleSearch.filter.dc.description.provenance">Provenance</message>
	<message key="xmlui.ArtifactBrowser.SimpleSearch.filter.provenance">Provenance</message>
	<message key="xmlui.ArtifactBrowser.SimpleSearch.filter.provenance_filter">Provenance</message>