Class SolrResponseStandardFacetDecorator
- java.lang.Object
-
- com.broadleafcommerce.search.provider.solr.response.SolrResponseFacetDecorator<org.apache.solr.client.solrj.response.FacetField,org.apache.solr.client.solrj.response.FacetField.Count>
-
- com.broadleafcommerce.search.provider.solr.response.SolrResponseStandardFacetDecorator
-
- All Implemented Interfaces:
SolrResponseDecorator
public class SolrResponseStandardFacetDecorator extends SolrResponseFacetDecorator<org.apache.solr.client.solrj.response.FacetField,org.apache.solr.client.solrj.response.FacetField.Count>
Decorates theSearchResponsewithFacetResponses associated to standard valued non-ranged facets
-
-
Field Summary
-
Fields inherited from class com.broadleafcommerce.search.provider.solr.response.SolrResponseFacetDecorator
solrFieldService
-
-
Constructor Summary
Constructors Constructor Description SolrResponseStandardFacetDecorator(com.broadleafcommerce.search.provider.solr.SolrFieldService solrFieldService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.broadleafcommerce.search.api.domain.FacetValuebuildFacetValue(com.broadleafcommerce.search.api.domain.Facet facet, org.apache.solr.client.solrj.response.FacetField.Count value, com.broadleafcommerce.search.api.domain.Filter facetFilter)Create theFacetValuefor this facet value.protected StringgetSolrFacetFieldName(org.apache.solr.client.solrj.response.FacetField solrFacet)Get the Solr field name for the facet.protected List<org.apache.solr.client.solrj.response.FacetField>getSolrFacets(org.apache.solr.client.solrj.response.QueryResponse queryResponse)Retrieve the facets for this facet type from theQueryResponseprotected List<org.apache.solr.client.solrj.response.FacetField.Count>getSolrFacetValues(org.apache.solr.client.solrj.response.FacetField solrFacet)Retrieve the values with counts from the Solr facet.protected booleanisActiveFacetValue(org.apache.solr.client.solrj.response.FacetField.Count facetValue, com.broadleafcommerce.search.api.domain.Filter facetFilter)Check if this facet's filter is active on this value.-
Methods inherited from class com.broadleafcommerce.search.provider.solr.response.SolrResponseFacetDecorator
buildFacetFromField, buildFacetResponse, buildFacetResponses, buildFacetValues, decorate, facetMatchesField, getFacetFilter, getFacetForField, getSolrFieldService, getTypeFactory, sortFacetResponses
-
-
-
-
Method Detail
-
getSolrFacets
protected List<org.apache.solr.client.solrj.response.FacetField> getSolrFacets(org.apache.solr.client.solrj.response.QueryResponse queryResponse)
Description copied from class:SolrResponseFacetDecoratorRetrieve the facets for this facet type from theQueryResponse- Specified by:
getSolrFacetsin classSolrResponseFacetDecorator<org.apache.solr.client.solrj.response.FacetField,org.apache.solr.client.solrj.response.FacetField.Count>- Parameters:
queryResponse- Response from Solr for search- Returns:
- All facets of the type to process
-
getSolrFacetFieldName
protected String getSolrFacetFieldName(org.apache.solr.client.solrj.response.FacetField solrFacet)
Description copied from class:SolrResponseFacetDecoratorGet the Solr field name for the facet.- Specified by:
getSolrFacetFieldNamein classSolrResponseFacetDecorator<org.apache.solr.client.solrj.response.FacetField,org.apache.solr.client.solrj.response.FacetField.Count>- Parameters:
solrFacet- Facet from Solr- Returns:
- Type-qualified Solr field name
-
getSolrFacetValues
protected List<org.apache.solr.client.solrj.response.FacetField.Count> getSolrFacetValues(org.apache.solr.client.solrj.response.FacetField solrFacet)
Description copied from class:SolrResponseFacetDecoratorRetrieve the values with counts from the Solr facet.- Specified by:
getSolrFacetValuesin classSolrResponseFacetDecorator<org.apache.solr.client.solrj.response.FacetField,org.apache.solr.client.solrj.response.FacetField.Count>- Parameters:
solrFacet- Facet from Solr- Returns:
- Values for the facet
-
buildFacetValue
protected com.broadleafcommerce.search.api.domain.FacetValue buildFacetValue(com.broadleafcommerce.search.api.domain.Facet facet, org.apache.solr.client.solrj.response.FacetField.Count value, @Nullable com.broadleafcommerce.search.api.domain.Filter facetFilter)Description copied from class:SolrResponseFacetDecoratorCreate theFacetValuefor this facet value.- Specified by:
buildFacetValuein classSolrResponseFacetDecorator<org.apache.solr.client.solrj.response.FacetField,org.apache.solr.client.solrj.response.FacetField.Count>- Parameters:
facet- Search facet to which this value belongsvalue- Facet value from Solr facetfacetFilter- Current filter associated with this facet on search- Returns:
- Search facet value for this type of facet
-
isActiveFacetValue
protected boolean isActiveFacetValue(org.apache.solr.client.solrj.response.FacetField.Count facetValue, @Nullable com.broadleafcommerce.search.api.domain.Filter facetFilter)Check if this facet's filter is active on this value.- Parameters:
facetValue- the value to check if activefacetFilter- the filter on this facet- Returns:
- whether the facet is filtered on this value
-
-