Class FacetPopulator
java.lang.Object
com.hybris.merchandising.converters.populators.FacetPopulator
- All Implemented Interfaces:
Populator<ProductIndexContainer,Product>
Populates
FacetPopulator from ProductIndexContainer which encapsulates the information regarding the
indexed product details-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FacetValuecreateFacetValueMapping(Object fieldValue, SearchQuery query, IndexedProperty indexedProperty, Object displayNameProvider) Helper method to create aFacetValuefor a given facet.protected FacetValuecreateFacetValueMapping(String fieldValue, SearchQuery query, IndexedProperty indexedProperty, Object displayNameProvider) Helper method to create aFacetValuefor a given facet.protected List<FacetValue>createMerchFacetValues(FacetField facet, SearchQuery query, IndexedProperty indexedProperty, InputDocument document, IndexedPropertyInfo indexedPropertyInfo) Helper method to retrieve the values for a provided facet.protected static ObjectUtility method for retrieving a bean from the configured bean factory.voidpopulate(ProductIndexContainer source, Product target) Populate the target instance with values from the source instance.protected StringresolveFacetValueDisplayName(SearchQuery searchQuery, IndexedProperty indexedProperty, Object facetDisplayNameProvider, String facetValue) Helper method to retrieve the display name for a given facet value.protected StringresolveFacetValueDisplayNameUsingLegacyProvider(SearchQuery searchQuery, Object facetDisplayNameProvider, String facetValue) resolveFacetValueDisplayNameUsingLegacyProvider is a method for retrieving the display name provider for a facet where the provider is an instance of the deprecatedFacetDisplayNameProvider.
-
Constructor Details
-
FacetPopulator
public FacetPopulator()
-
-
Method Details
-
populate
Populate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<ProductIndexContainer,Product> - Parameters:
source- the source objecttarget- the target to fill- Throws:
ConversionException- if an error occurs
-
resolveFacetValueDisplayName
protected String resolveFacetValueDisplayName(SearchQuery searchQuery, IndexedProperty indexedProperty, Object facetDisplayNameProvider, String facetValue) Helper method to retrieve the display name for a given facet value.- Parameters:
searchQuery- theSearchQuerybeing used for the current Solr indexing process.indexedProperty- theIndexedPropertywe wish to look up.facetDisplayNameProvider- the display name provider, an instance of the class used to retrieve the display name of the facet.facetValue- the value of the facet being used.- Returns:
- the display name for the facet value, or the value itself if we can not derive it.
-
resolveFacetValueDisplayNameUsingLegacyProvider
protected String resolveFacetValueDisplayNameUsingLegacyProvider(SearchQuery searchQuery, Object facetDisplayNameProvider, String facetValue) resolveFacetValueDisplayNameUsingLegacyProvider is a method for retrieving the display name provider for a facet where the provider is an instance of the deprecatedFacetDisplayNameProvider.- Parameters:
searchQuery- theSearchQuerybeing used for the current Solr indexing process.facetDisplayNameProvider- the display name provider, an instance of the class used to retrieve the display name of the facet.facetValue- the value of the facet being used.- Returns:
- the display name for the facet value.
-
getFacetDisplayNameProvider
Utility method for retrieving a bean from the configured bean factory.- Parameters:
facet-- Returns:
-
createMerchFacetValues
protected List<FacetValue> createMerchFacetValues(FacetField facet, SearchQuery query, IndexedProperty indexedProperty, InputDocument document, IndexedPropertyInfo indexedPropertyInfo) Helper method to retrieve the values for a provided facet.- Parameters:
facet- theFacetFieldwe wish to retrieve values for.query- theSearchQuerybeing used for the current Solr indexing process.indexedProperty- theIndexedPropertywe wish to look up.document- theInputDocumentwe wish to retrieve the value from.indexedPropertyInfo- theIndexedPropertyInfowe retrieve the translated field name from.- Returns:
- a List of
FacetValueobjects.
-
createFacetValueMapping
protected FacetValue createFacetValueMapping(String fieldValue, SearchQuery query, IndexedProperty indexedProperty, Object displayNameProvider) Helper method to create aFacetValuefor a given facet.- Parameters:
fieldValue- a String representing the raw facet value.query- theSearchQuerybeing used for the current Solr indexing process.indexedProperty- theIndexedPropertywe wish to look up.displayNameProvider- the configured facet display name provider being used.- Returns:
- an instance of
FacetValuerepresenting this facet.
-
createFacetValueMapping
protected FacetValue createFacetValueMapping(Object fieldValue, SearchQuery query, IndexedProperty indexedProperty, Object displayNameProvider) Helper method to create aFacetValuefor a given facet.- Parameters:
fieldValue- an Object representing the raw facet value.query- theSearchQuerybeing used for the current Solr indexing process.indexedProperty- theIndexedPropertywe wish to look up.displayNameProvider- the configured facet display name provider being used.- Returns:
- an instance of
FacetValuerepresenting this facet.
-