Class SolrFacetConfig

java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.search.impl.solr.facet.SolrFacetConfig
All Implemented Interfaces:
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
  • Constructor Details

    • SolrFacetConfig

      public SolrFacetConfig(Properties rawProperties, String inheritanceOrder)
  • Method Details

    • setNamespaceService

      public void setNamespaceService(NamespaceService namespaceService)
      Parameters:
      namespaceService - the namespaceService to set
    • getDefaultFacets

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