Interface SearchFacet
- All Superinterfaces:
org.broadleafcommerce.common.copy.MultiTenantCloneable<SearchFacet>,Serializable
- All Known Implementing Classes:
SearchFacetImpl
public interface SearchFacet
extends Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<SearchFacet>
A SearchFacet is an object that represents a particular facet that can be used to guide faceted
searching on a results page.
- Author:
- Andre Azzolini (apazzolini)
-
Method Summary
Modifier and TypeMethodDescriptionGets whether or not you can multiselect values for this FacetThis String represents the FieldType for the given SearchFacet.getField()Returns the field associated with this facet.The main relationship to the rest of the search index entitiesgetId()Returns the internal idgetLabel()Gets the label of this SearchFacet.getName()Gets the name of this SearchFacet.This boolean controls whether or not this particular facet requires one of the dependent facets to be active, or if it requires all of the dependent facets to be active.Gets the display priority of this SearchFacet on search result pagesGets the applicable ranges for this search facet, if any are specified.Gets a boolean that specifies whether or not this SearchFacet should be displayed on search result pages in addition to category pagesGets whether or not this facet uses facet rangesvoidsetCanMultiselect(Boolean canMultiselect) Sets whether or not you can multiselect values for this Facet.voidsetFieldType(IndexFieldType fieldType) voidSets the internal idvoidSets the labelvoidSets the namevoidsetRequiredFacets(List<RequiredFacet> requiredFacets) Sets the list of facets which this facet depends on.voidsetRequiresAllDependentFacets(Boolean requiresAllDependentFacets) Sets whether or not all dependent facets must be active, or if only one is necessaryvoidsetSearchDisplayPriority(Integer searchDisplayPriority) Sets the display priority on search result pagesvoidsetSearchFacetRanges(List<SearchFacetRange> searchFacetRanges) Sets the SearchFacetRanges Note: This method will set ALL search facet rangesvoidsetShowOnSearch(Boolean showOnSearch) Sets showOnSearchvoidsetUseFacetRanges(Boolean useFacetRanges) Sets useFacetRangesMethods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable
createOrRetrieveCopyInstance
-
Method Details
-
getId
Long getId()Returns the internal id- Returns:
- the internal id
-
setId
Sets the internal id- Parameters:
id-
-
getFieldType
IndexFieldType getFieldType()The main relationship to the rest of the search index entities -
setFieldType
-
getField
Field getField()Returns the field associated with this facet.
This is a convenience method for
getFieldType().getIndexField().getField()- Returns:
- the fieldName
-
getFacetFieldType
String getFacetFieldType()This String represents the FieldType for the given SearchFacet. This is the FieldType that will be used when this Field is indexed in Solr
This is a convience method for
getFieldType().getFieldType().getType()- Returns:
- the String representing the FieldType of this SearchFacet
-
getName
String getName()Gets the name of this SearchFacet. This is for admin naming purposes.- Returns:
- the name
-
setName
Sets the name- Parameters:
name-- See Also:
-
getLabel
String getLabel()Gets the label of this SearchFacet. This is the label that will be used for the user-friendly display name of this facet- Returns:
- the label
-
setLabel
Sets the label- Parameters:
label-- See Also:
-
getShowOnSearch
Boolean getShowOnSearch()Gets a boolean that specifies whether or not this SearchFacet should be displayed on search result pages in addition to category pages- Returns:
- whether or not to display on search result pages
-
setShowOnSearch
Sets showOnSearch- Parameters:
showOnSearch-- See Also:
-
getSearchDisplayPriority
Integer getSearchDisplayPriority()Gets the display priority of this SearchFacet on search result pages- Returns:
- the priority
-
setSearchDisplayPriority
Sets the display priority on search result pages- Parameters:
searchDisplayPriority-
-
getCanMultiselect
Boolean getCanMultiselect()Gets whether or not you can multiselect values for this Facet- Returns:
- the multiselect flag
-
setCanMultiselect
Sets whether or not you can multiselect values for this Facet.- Parameters:
canMultiselect-
-
getUseFacetRanges
Boolean getUseFacetRanges()Gets whether or not this facet uses facet ranges- Returns:
- the useFacetRanges flag
-
setUseFacetRanges
Sets useFacetRanges- See Also:
-
getSearchFacetRanges
List<SearchFacetRange> getSearchFacetRanges()Gets the applicable ranges for this search facet, if any are specified. For example, the SearchFacet that interacts with "Manufacturers" might not have any ranges defined (as it would depend on the manufacturers that are in the result list), but a facet on "Price" might have predefined ranges (such as 0-5, 5-10, 10-20).- Returns:
- the associated search facet ranges, if any
-
setSearchFacetRanges
Sets the SearchFacetRanges Note: This method will set ALL search facet ranges- Parameters:
searchFacetRanges-- See Also:
-
getRequiredFacets
List<RequiredFacet> getRequiredFacets()- Returns:
- a list of SearchFacets that must have an active value set for this SearchFacet to be applicable.
- See Also:
-
setRequiredFacets
Sets the list of facets which this facet depends on.- Parameters:
requiredFacets-
-
getRequiresAllDependentFacets
Boolean getRequiresAllDependentFacets()This boolean controls whether or not this particular facet requires one of the dependent facets to be active, or if it requires all of the dependent facets to be active.- Returns:
- whether the dependent facet list should be AND'ed together
- See Also:
-
setRequiresAllDependentFacets
Sets whether or not all dependent facets must be active, or if only one is necessary- Parameters:
requiresAllDependentFacets-
-