Additional handling for "special" facet IDs (SITE, TAG etc). Part of ACE-2639.

This check-in ensures that those facet IDs are not prefixed with the '@' char like all other facet IDs.
The list is currently injected from solr-facets-context.xml, which required a slight refactoring of spring beans to make SolrFacetHelper a bean.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@85711 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2014-09-25 11:29:05 +00:00
parent c0da5f58ac
commit e52aede98f
4 changed files with 57 additions and 2 deletions

View File

@@ -105,7 +105,17 @@ public class SolrFacetHelper
BUCKETED_FIELD_FACETS.add(MODIFIED_FIELD_FACET_QUERY);
BUCKETED_FIELD_FACETS.add(CONTENT_SIZE_FIELD_FACET_QUERY);
}
/** These facet IDs are recognised by SOLR and can be used directly within facetted searches. */
private Set<String> specialFacetIds = Collections.emptySet();
{
}
public void setSpecialFacetIds(Set<String> ids)
{
this.specialFacetIds = ids;
}
/** Facet value and facet query display label handlers */
private Map<String, FacetLabelDisplayHandler> displayHandlers;
@@ -288,6 +298,15 @@ public class SolrFacetHelper
{
return Collections.unmodifiableSet(BUCKETED_FIELD_FACETS);
}
/**
* Is the specified facet ID part of the list of "specials" which are
* handled by our SOLR service as is?
*/
public boolean isSpecialFacetId(String facetId)
{
return specialFacetIds.contains(facetId);
}
/**
* Creates Date buckets. The dates are in ISO8601 format (yyyy-MM-dd)