Add new Discovery search filter & facet fields in dspace

1- add the field to indeing

edit the files dspace.cfg

The search commands are written as “search.index.# = [name]:[schema].[element].[qualifier]”

add the field in this section

changing these will change your search results

search.index.6 = abstract:dc.description.abstract

 

2- add the field text in

  i18n/messages.xml
like
    <message key=”xmlui.ArtifactBrowser.AdvancedSearch.type_abstract”>abstract</message>
    <message key=”xmlui.ArtifactBrowser.SimpleSearch.filter.abstract”>abstract</message>

3- Creating a new discovery bean

open the file

[Dspace]/config/spring/api/discovery.xml

add the new fitler field to this section

<list>
    <refbean="searchFilterTitle"/>
    <refbean="searchFilterAuthor"/>
    <refbean="searchFilterSubject"/>
    <refbean="searchFilterAbstract"/>
</list>
for facet add it in this section
<property name=”sidebarFacets”>
<list>
<ref bean=”searchFilterAuthor” />
<ref bean=”searchFilterSubject” />
<ref bean=”searchFilterPublisher” />
<ref bean=”searchFilterIssued” />
<ref bean=”searchFilterAbstract” />

</list>

4- then create the field configuration beans
<!–Search filter configuration beans–>
<bean id=”searchFilterAbstract” class=”org.dspace.discovery.configuration.DiscoverySearchFilterFacet”>
<property name=”indexFieldName” value=”abstract”/>
<property name=”metadataFields”>
<list>
<value>dc.description.abstract</value>
</list>
</property>
</bean>
5- reindex discovery and restart tomcat
./dspace index-discovery -f
service tomcat7 restart
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s