Class FacetPopulator

java.lang.Object
com.hybris.merchandising.converters.populators.FacetPopulator
All Implemented Interfaces:
Populator<ProductIndexContainer,Product>

public class FacetPopulator extends Object implements Populator<ProductIndexContainer,Product>
Populates FacetPopulator from ProductIndexContainer which encapsulates the information regarding the indexed product details
  • Constructor Details

    • FacetPopulator

      public FacetPopulator()
  • Method Details

    • populate

      public void populate(ProductIndexContainer source, Product target) throws ConversionException
      Populate the target instance with values from the source instance.
      Specified by:
      populate in interface Populator<ProductIndexContainer,Product>
      Parameters:
      source - the source object
      target - 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 - the SearchQuery being used for the current Solr indexing process.
      indexedProperty - the IndexedProperty we 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 deprecated FacetDisplayNameProvider.
      Parameters:
      searchQuery - the SearchQuery being 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 Object getFacetDisplayNameProvider(FacetField facet)
      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 - the FacetField we wish to retrieve values for.
      query - the SearchQuery being used for the current Solr indexing process.
      indexedProperty - the IndexedProperty we wish to look up.
      document - the InputDocument we wish to retrieve the value from.
      indexedPropertyInfo - the IndexedPropertyInfo we retrieve the translated field name from.
      Returns:
      a List of FacetValue objects.
    • createFacetValueMapping

      protected FacetValue createFacetValueMapping(String fieldValue, SearchQuery query, IndexedProperty indexedProperty, Object displayNameProvider)
      Helper method to create a FacetValue for a given facet.
      Parameters:
      fieldValue - a String representing the raw facet value.
      query - the SearchQuery being used for the current Solr indexing process.
      indexedProperty - the IndexedProperty we wish to look up.
      displayNameProvider - the configured facet display name provider being used.
      Returns:
      an instance of FacetValue representing this facet.
    • createFacetValueMapping

      protected FacetValue createFacetValueMapping(Object fieldValue, SearchQuery query, IndexedProperty indexedProperty, Object displayNameProvider)
      Helper method to create a FacetValue for a given facet.
      Parameters:
      fieldValue - an Object representing the raw facet value.
      query - the SearchQuery being used for the current Solr indexing process.
      indexedProperty - the IndexedProperty we wish to look up.
      displayNameProvider - the configured facet display name provider being used.
      Returns:
      an instance of FacetValue representing this facet.