2015-02-24 37 views
0

我想添加「教育水平」 - > [dcterms.educationlevel]作爲側邊欄方面和搜索過濾器。 我做了所有的事情一樣 - > 添加以下代碼段爲 「discovery.xml」 - >新添加的過濾器沒有進入側邊欄

<bean id="educationLevel" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"> 
 
    <property name="indexFieldName" value="educationlevel"/> 
 
    <property name="metadataFields"> 
 
     <list> 
 
      <value>dcterms.educationlevel</value> 
 
     </list> 
 
    </property> 
 
    <property name="type" value="text"/> 
 
    <property name="sortOrder" value="VALUE"/> 
 
</bean>

,並添加以下行

\t \t <ref bean="educationLevel" />

到以下區域(in 'discovery.xml')

<!--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> 
 
       \t <ref bean="searchFilterAuthor" /> 
 
\t \t <ref bean="searchFilterType" /> 
 
\t \t <ref bean="searchFilterSubject" /> 
 
       <ref bean="searchFilterIssued" /> 
 
\t \t <ref bean="searchFilterMIMEType" /> 
 
\t \t <ref bean="searchFilterLanguage" /> 
 
\t \t <ref bean="searchFilterSourceOrganization" /> 
 
\t \t <ref bean="typeOfLearningMaterial" /> 
 
\t \t <ref bean="difficultyLevel" /> 
 
\t \t **<ref bean="educationLevel" />** 
 
      </list> 
 
     </property> 
 
     <!--The search filters which can be used on the discovery search page--> 
 
     <property name="searchFilters"> 
 
      <list> 
 
       <ref bean="searchFilterTitle" /> 
 
\t \t <ref bean="searchFilterAuthor" /> 
 
\t \t <ref bean="searchFilterType" /> 
 
       <ref bean="searchFilterSubject" /> 
 
       <ref bean="searchFilterIssued" /> 
 
\t \t <ref bean="searchFilterMIMEType" /> 
 
\t \t <ref bean="searchFilterLanguage" /> 
 
\t \t <ref bean="searchFilterSourceOrganization" /> 
 
\t \t <ref bean="typeOfLearningMaterial" /> 
 
\t \t <ref bean="difficultyLevel" /> 
 
\t \t **<ref bean="educationLevel" />** 
 
      </list> 
 
     </property>

,並添加在下文提到的區域,

<bean id="homepageConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype">

,並且還添加行

search.index.15 = educationlevel:dcterms.educationlevel

'[dSPACE的安裝] /config/dspace.cfg' 文件

,並且還添加行

\t <message key="xmlui.ArtifactBrowser.SimpleSearch.filter.educationlevel">Education Level</message>

在文件中 - > [dspace-install] /webapps/xmlui/i18n/messages.xml

但它不是側邊欄方面,請幫助。

+0

您在修改discovery.xml後是否嘗試過運行'index-discovery -b'或'index-discovery -f'? – euler 2015-02-24 07:19:06

+0

是的,我做到了。我對學習材料類型[dc.type.typeoflearningmaterial],難度級別[dc.format.difficultylevel]做了所有相同的事情。那些工作,但上面說的一個不工作。從[dSPACE的安裝]目錄的端子>「倉/ dSPACE的索引發現-b」 - – 2015-02-24 08:43:15

+0

@euler,我已經運行的命令。 – 2015-02-24 08:58:08

回答

1

確保實際上存在具有該元數據的項目。在你的評論中,你說過你添加的其他自定義側邊欄的作品,除了dcterms.educationlevel。作爲測試,請嘗試編輯您的一個項目並添加該元數據。

Sidebar Facets的另一個重要特性是它們的內容會自動更新到頁面的上下文中。在收集主頁或社區主頁時,它將包含關於該特定收集或社區中包含的項目的信息。

它也會在搜索後顯示。如果元數據註冊表中不存在元數據,則必須先手動添加它(我認爲您已經這樣做了,因爲您包含的其他元數據不在默認元數據註冊表中)。

+0

我可以檢測到錯誤。實際上,元數據字段會 - >「dcterms.educationLevel」,但我用 - >「dcterms.educationlevel」。有一個拼寫錯誤,只是因爲它不起作用。非常抱歉。 – 2015-02-25 06:07:43

相關問題