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

import marc file into dspace

download this script from github

https://github.com/amdmaher/import-marc-into-dspace

1- check the marc file

2- run mk2dc.pl to convert from mrc to dubline core
./mk2dc.pl 762.mrc > 762.xml

3- create import dir

mkdir import

4- run build.pl to build dspace file folders

this ./build.pl 762.xml
5- now import records to dspace
./dspace import -a -e email@mail.com -c [CollectionID] -s import -m mapfile

add another language to dspace

to add another language to dspace follow these steps :

if you using JSPUI

webui.supported.locales = ar, en

and you can set the default language 

default.locale = ar

now add you language  messages file to you dspace in the path

dspace-source/dspace-api/src/main/resources/

before start instalation and name the file like this

Messages_ar.properties

 =================================================

if you are using XMLUI 

add you language to dspace.cfg file 

xmlui.supported.locales = ar, en

and your langauge file 

messages_ar.xml

to the path 

dspace\webapps\xmlui\i18n

 

and now you add language switch html code to your theme file in the theme folder 

dspace\webapps\xmlui\themes

for example : if you use mirage theme add it in the file 

dspace\webapps\xmlui\themes\Mirage\lib\xsl\core\page-structure.xsl

any where you want 

like this

 <div style=”margin-right:300px;direction:rtl”> language :: <a href=”/xmlui?locale-attribute=ar”> Arabic</a> | <a href=”/xmlui?locale-attribute=en”> English </a> </div>