Class SolrFacetConfig

  • All Implemented Interfaces:
    java.util.EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

    public class SolrFacetConfig
    extends org.springframework.extensions.surf.util.AbstractLifecycleBean
    This class picks up all the loaded properties passed to it and uses a naming convention to isolate the default and custom facets and related values.

    So, if a new facet filter_abc is required for the cm:content.mimetype, then the following needs to be put into a properties file. The search for the additional custom properties file is tomcat/shared/classes/alfresco/extension/solr-facets-config-custom.properties:

    • custom.cm\:content.mimetype.filterID=filter_abc
    • custom.cm\:content.mimetype.displayName=faceted-search.facet-menu.facet.formats
    • custom.cm\:content.mimetype.displayControl=alfresco/search/FacetFilters
    • custom.cm\:content.mimetype.maxFilters=5
    • custom.cm\:content.mimetype.hitThreshold=1
    • custom.cm\:content.mimetype.minFilterValueLength=4
    • custom.cm\:content.mimetype.sortBy=DESCENDING
    • custom.cm\:content.mimetype.scope=SCOPED_SITES
    • custom.cm\:content.mimetype.scopedSites=site1,site2,site3
    • custom.cm\:content.mimetype.isEnabled=true
    Also, if there is a need to add additional properties, the following needs to be put into a properties file:
    • custom.cm\:content.mimetype.EXTRA-PROP.blockIncludeFacetRequest=true
    • custom.cm\:content.mimetype.EXTRA-PROP.moreProp=additionalInfo
    The inheritance order is strictly defined using property:
    ${solr_facets.inheritanceHierarchy}
    The default inheritance orders are:
    solr_facets.inheritanceHierarchy=default,custom i.e. the default facet's values are retrieved first and then overlayed with values from the custom facet.
    Author:
    Jamal Kaabi-Mofrad
    • Field Summary

      • Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean

        log
    • Constructor Summary

      Constructors 
      Constructor Description
      SolrFacetConfig​(java.util.Properties rawProperties, java.lang.String inheritanceOrder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​SolrFacetProperties> getDefaultFacets()  
      protected void onBootstrap​(org.springframework.context.ApplicationEvent event)  
      protected void onShutdown​(org.springframework.context.ApplicationEvent event)  
      void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)  
      • Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean

        getApplicationContext, onApplicationEvent, setApplicationContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SolrFacetConfig

        public SolrFacetConfig​(java.util.Properties rawProperties,
                               java.lang.String inheritanceOrder)
    • Method Detail

      • setNamespaceService

        public void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)
        Parameters:
        namespaceService - the namespaceService to set
      • getDefaultFacets

        public java.util.Map<java.lang.String,​SolrFacetProperties> getDefaultFacets()
      • onBootstrap

        protected void onBootstrap​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
      • onShutdown

        protected void onShutdown​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean