Hi Pablo,

I think the problem is that collection is not a metadata field. So you need to add some fields to the Solr index. I wrote a pull request (https://github.com/DSpace/DSpace/pull/988) to make filtering for items with full text possible.

This is possible by:
- adding a FilterPlugin like my dspace-api/src/main/java/org/dspace/discovery/SolrServiceFullTextFilterPlugin.java - referencing it in the discovery.xml to activate it (see line 36 in my pull request).
- and using it the same way I used it (in lines 414-423)

Hope this helps
Christian




Am 24.07.2015 um 14:22 schrieb Pablo Buenaposada:
I don't know if you understand me.
>From what I know, to make a sidebar facet work you need to create mandatory
a search filter, so, is not helpful... is required!
My problem is not about making the sidebar facet appear in
community/collection level, the problem is that in nowhere appears it. This
is my discovery.xml of a clean 5.2 version with the collection search filter
configured not working:




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

<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";
        xmlns:util="http://www.springframework.org/schema/util";
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util-3.0.xsd";
     default-autowire-candidates="*Service,*DAO,javax.sql.DataSource">

     <context:annotation-config />

     <bean id="solrServiceResourceIndexPlugin"
class="org.dspace.discovery.SolrServiceResourceRestrictionPlugin"
scope="prototype"/>
     <bean id="SolrServiceSpellIndexingPlugin"
class="org.dspace.discovery.SolrServiceSpellIndexingPlugin"
scope="prototype"/>

     <alias name="solrServiceResourceIndexPlugin"
alias="org.dspace.discovery.SolrServiceResourceRestrictionPlugin"/>

<bean id="solrBrowseIndexer" scope="prototype"
           class="org.dspace.browse.SolrBrowseCreateDAO">
     </bean>

<bean
id="org.dspace.discovery.configuration.DiscoveryConfigurationService"
class="org.dspace.discovery.configuration.DiscoveryConfigurationService">
         <property name="map">
             <map>
<entry key="default" value-ref="defaultConfiguration" />

<entry key="site" value-ref="homepageConfiguration" /> </map>
         </property>
         <property name="toIgnoreMetadataFields">
             <map>
                 <entry>
                     <key><util:constant
static-field="org.dspace.core.Constants.COMMUNITY"/></key>
                     <list>
<value>dc.rights</value> </list>
                 </entry>
                 <entry>
                     <key><util:constant
static-field="org.dspace.core.Constants.COLLECTION"/></key>
                     <list>
<value>dc.rights</value> </list>
                 </entry>
                 <entry>
                     <key><util:constant
static-field="org.dspace.core.Constants.ITEM"/></key>
                     <list>
                         <value>dc.description.provenance</value>
                     </list>
                 </entry>
             </map>
         </property>
     </bean>

<bean id="defaultConfiguration"
class="org.dspace.discovery.configuration.DiscoveryConfiguration"
scope="prototype">
<property name="sidebarFacets">
             <list>
                 <ref bean="searchFilterAuthor" />
                 <ref bean="searchFilterSubject" />
                 <ref bean="searchFilterIssued" />
                 <ref bean="searchFilterCollection" />
             </list>
         </property>
<property name="tagCloudFacetConfiguration"
ref="defaultTagCloudFacetConfiguration"/>
<property name="searchFilters">
             <list>
                 <ref bean="searchFilterTitle" />
                 <ref bean="searchFilterAuthor" />
                 <ref bean="searchFilterSubject" />
                 <ref bean="searchFilterIssued" />
                 <ref bean="searchFilterCollection" />
             </list>
         </property>
<property name="searchSortConfiguration">
             <bean
class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
<property name="defaultSortOrder" value="desc"/>
                 <property name="sortFields">
                     <list>
                         <ref bean="sortTitle" />
                         <ref bean="sortDateIssued" />
                         <ref bean="sortCollection" />
                     </list>
                 </property>
             </bean>
         </property>
<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="20"/>
<property name="useAsHomePage" value="false"/>
             </bean>
         </property>
<property name="defaultRpp" value="10" />
         <property name="hitHighlightingConfiguration">
             <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightingConfiguration">
                 <property name="metadataFields">
                     <list>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field" value="dc.title"/>
                             <property name="snippets" value="5"/>
                         </bean>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field"
value="dc.contributor.author"/>
                             <property name="snippets" value="5"/>
                         </bean>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field"
value="dc.description.abstract"/>
                             <property name="maxSize" value="250"/>
                             <property name="snippets" value="2"/>
                         </bean>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field" value="fulltext"/>
                             <property name="maxSize" value="250"/>
                             <property name="snippets" value="2"/>
                         </bean>
                     </list>
                 </property>
             </bean>
         </property>
         <property name="moreLikeThisConfiguration">
             <bean
class="org.dspace.discovery.configuration.DiscoveryMoreLikeThisConfiguration">
<property name="similarityMetadataFields">
                     <list>
                         <value>dc.title</value>
                         <value>dc.contributor.author</value>
                         <value>dc.creator</value>
                         <value>dc.subject</value>
                     </list>
                 </property>
<property name="minTermFrequency" value="5"/> <property name="max" value="3"/> <property name="minWordLength" value="5"/>
             </bean>
         </property>
<property name="spellCheckEnabled" value="true"/>
     </bean>


<bean id="homepageConfiguration"
class="org.dspace.discovery.configuration.DiscoveryConfiguration"
scope="prototype">
<property name="sidebarFacets">
             <list>
                 <ref bean="searchFilterAuthor" />
                 <ref bean="searchFilterSubject" />
                 <ref bean="searchFilterIssued" />
                 <ref bean="searchFilterCollection" />
             </list>
         </property>
<property name="tagCloudFacetConfiguration"
ref="homepageTagCloudFacetConfiguration"/>
<property name="searchFilters">
             <list>
                 <ref bean="searchFilterTitle" />
                 <ref bean="searchFilterAuthor" />
                 <ref bean="searchFilterSubject" />
                 <ref bean="searchFilterIssued" />
                 <ref bean="searchFilterCollection" />
             </list>
         </property>
<property name="searchSortConfiguration">
             <bean
class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
<property name="defaultSortOrder" value="desc"/>
                 <property name="sortFields">
                     <list>
                         <ref bean="sortTitle" />
                         <ref bean="sortDateIssued" />
                         <ref bean="sortCollection" />
                     </list>
                 </property>
             </bean>
         </property>
<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="5"/>
                 <property name="useAsHomePage" value="false"/>
             </bean>
         </property>
         <property name="hitHighlightingConfiguration">
             <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightingConfiguration">
                 <property name="metadataFields">
                     <list>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field" value="dc.title"/>
                             <property name="snippets" value="5"/>
                         </bean>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field"
value="dc.contributor.author"/>
                             <property name="snippets" value="5"/>
                         </bean>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field"
value="dc.description.abstract"/>
                             <property name="maxSize" value="250"/>
                             <property name="snippets" value="2"/>
                         </bean>
                         <bean
class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
                             <property name="field" value="fulltext"/>
                             <property name="maxSize" value="250"/>
                             <property name="snippets" value="2"/>
                         </bean>
                     </list>
                 </property>
             </bean>
         </property>
<property name="spellCheckEnabled" value="true"/>
     </bean>

<bean id="homepageTagCloudFacetConfiguration"
class="org.dspace.discovery.configuration.TagCloudFacetConfiguration">
<property name="tagCloudConfiguration" ref="tagCloudConfiguration"/> <property name="tagCloudFacets">
             <list>
                 <ref bean="searchFilterSubject" />
             </list>
         </property>
     </bean>
<bean id="defaultTagCloudFacetConfiguration"
class="org.dspace.discovery.configuration.TagCloudFacetConfiguration">
<property name="tagCloudConfiguration" ref="tagCloudConfiguration"/> <property name="tagCloudFacets">
             <list>
                 <ref bean="searchFilterSubject" />
             </list>
         </property>
     </bean>
<bean id="tagCloudConfiguration"
class="org.dspace.discovery.configuration.TagCloudConfiguration">
                
                
                
                
                
                
                
                
                
                
                
                
                
                

                
                
                
                
                
                
                
                

                
                        
     </bean>
<bean id="browseTagCloudConfiguration"
class="org.dspace.discovery.configuration.TagCloudConfiguration">
                
                
                
                
                
                
                
                
                
                
                
                
                
                

                
                
                
                
                
                
                
                
        
                
                        
     </bean>
<bean id="searchFilterTitle"
class="org.dspace.discovery.configuration.DiscoverySearchFilter">
         <property name="indexFieldName" value="title"/>
         <property name="metadataFields">
             <list>
                 <value>dc.title</value>
             </list>
         </property>
     </bean>

     <bean id="searchFilterAuthor"
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
         <property name="indexFieldName" value="author"/>
         <property name="metadataFields">
             <list>
                 <value>dc.contributor.author</value>
                 <value>dc.creator</value>
             </list>
         </property>
         <property name="facetLimit" value="10"/>
         <property name="sortOrder" value="COUNT"/>
     </bean>

     <bean id="searchFilterSubject"
class="org.dspace.discovery.configuration.HierarchicalSidebarFacetConfiguration">
         <property name="indexFieldName" value="subject"/>
         <property name="metadataFields">
             <list>
                 <value>dc.subject.*</value>
             </list>
         </property>
         <property name="facetLimit" value="10"/>
         <property name="sortOrder" value="COUNT"/>
         <property name="splitter" value="::"/>
     </bean>

     <bean id="searchFilterIssued"
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
         <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>

     <bean id="searchFilterCollection"
class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
        <property name="indexFieldName" value="collection"/>
         <property name="metadataFields">
             <list>
                <value>location.coll</value>
             </list>
        </property>
         <property name="type" value="date"/>
         <property name="sortOrder" value="VALUE"/>
     </bean>

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

     <bean id="sortCollection"
class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
        <property name="metadataField" value="location.coll"/>
     </bean>
</beans>


if I change the <value>location.coll</value> for
<value>dc.date.issued</value> the sidebar works flawless!



--
View this message in context: 
http://dspace.2283337.n4.nabble.com/discovery-facet-by-collection-tp4678162p4678919.html
Sent from the DSpace - Tech mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette




--
Christian Scheible
Softwareentwickler / Abt. Content-basierte Dienste
Kommunikations-, Informations- und Medienzentrum (KIM)
Universität Konstanz
78457 Konstanz
+49 (0)7531 / 88-2857
Raum B 703

------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to