Class FacetPopulator
- java.lang.Object
-
- com.hybris.merchandising.converters.populators.FacetPopulator
-
- All Implemented Interfaces:
Populator<ProductIndexContainer,Product>
public class FacetPopulator extends java.lang.Object implements Populator<ProductIndexContainer,Product>
PopulatesFacetPopulatorfromProductIndexContainerwhich encapsulates the information regarding the indexed product details
-
-
Constructor Summary
Constructors Constructor Description FacetPopulator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FacetValuecreateFacetValueMapping(java.lang.Object fieldValue, SearchQuery query, IndexedProperty indexedProperty, java.lang.Object displayNameProvider)Helper method to create aFacetValuefor a given facet.protected FacetValuecreateFacetValueMapping(java.lang.String fieldValue, SearchQuery query, IndexedProperty indexedProperty, java.lang.Object displayNameProvider)Helper method to create aFacetValuefor a given facet.protected java.util.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 java.lang.ObjectgetFacetDisplayNameProvider(FacetField facet)Utility 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 java.lang.StringresolveFacetValueDisplayName(SearchQuery searchQuery, IndexedProperty indexedProperty, java.lang.Object facetDisplayNameProvider, java.lang.String facetValue)Helper method to retrieve the display name for a given facet value.protected java.lang.StringresolveFacetValueDisplayNameUsingLegacyProvider(SearchQuery searchQuery, java.lang.Object facetDisplayNameProvider, java.lang.String facetValue)resolveFacetValueDisplayNameUsingLegacyProvider is a method for retrieving the display name provider for a facet where the provider is an instance of the deprecatedFacetDisplayNameProvider.
-
-
-
Method Detail
-
populate
public void populate(ProductIndexContainer source, Product target) throws ConversionException
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 java.lang.String resolveFacetValueDisplayName(SearchQuery searchQuery, IndexedProperty indexedProperty, java.lang.Object facetDisplayNameProvider, java.lang.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 java.lang.String resolveFacetValueDisplayNameUsingLegacyProvider(SearchQuery searchQuery, java.lang.Object facetDisplayNameProvider, java.lang.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
protected static java.lang.Object getFacetDisplayNameProvider(FacetField facet)
Utility method for retrieving a bean from the configured bean factory.- Parameters:
facet-- Returns:
-
createMerchFacetValues
protected java.util.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(java.lang.String fieldValue, SearchQuery query, IndexedProperty indexedProperty, java.lang.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(java.lang.Object fieldValue, SearchQuery query, IndexedProperty indexedProperty, java.lang.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.
-
-