SUNScholar/Search Indexes

From Libopedia
Revision as of 10:05, 7 May 2013 by Hgibson (talk | contribs)
Jump to navigation Jump to search

Template:SUNScholar

!!! WARNING !!!

https://jira.duraspace.org/browse/DS-1070

Not a good idea to enable Discovery in DSpace version 1.7.2

Introduction

This wiki help page assumes that you have used the three system setup procedures to install an Ubuntu server with DSpace software.

Before attempting SOLR discovery setup please make sure the following are correct:

  1. Tomcat is listening on TCP port 80.
  2. The SOLR webapp is correctly published.

Step 1

Setup solr search URL in config file.

nano /home/dspace/dspace-1.8.2-src-release/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

Step 3

Type the following to rebuild the discovery index.

/home/dspace/bin/dspace update-discovery-index -b

Example Spring Config

Below is an example file: /home/dspace/config/modules/spring/spring-dspace-addon-discover-configuration-services.xml.

<?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>

Check SOLR webapp operation

If you have problems with the SOLR webapp, then complete the following to check its operation.

Install the "lynx" application.

sudo apt-get install lynx

Then type the following in the console:

lynx http://localhost/solr

OR

lynx http://localhost:8080/solr

You should get the following:

Lynx-solr.png

If not debug the solr webapp until you can.

Remember to restart the Tomcat server for each change you make to a webapp configuration.

Template:CONSOLE

Back to Indexes