Skip to Content
author's profile photo Former Member
Former Member

Different attibutes to a products under one category ?

I've requirement where attributes for Products are not constant. There are different line of businesses (LOB), in each LOB - products may have different attributes. There might arise a case , where - products under one category may have different attributes. I'm considering Classification system for this - but i'm not sure whether we can apply classification system on each individual product if case arise. Is this the correct approach - Also i've to implement solr for this products. How complex can this become.

If i cant go with Classification system how can i achieve this requirement , where product attributes are different for different categories/products and might be added based on different LOB's.

Please advise ?

Thanks, Sandeep

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 13, 2015 at 04:38 PM

    Hi,
    Indeed classification is the right approach, it fulfills all your requirements, it can be applied to a single product and you can use "Valuelist" (enumtype) to have the attribute with an array of possible values. Solr will work with classification attributes.

    Useful links:
    Classification system :
    https://wiki.hybris.com/display/release5/Classification+Guide#ClassificationGuide-CategoryFeature
    https://wiki.hybris.com/display/release5/Creating+Classification+Systems
    https://wiki.hybris.com/display/release5/Creating+Classification+System+Versions
    https://wiki.hybris.com/display/release5/Creating+Classifying+Categories
    https://wiki.hybris.com/display/release5/Creating+Category+Features

    Configure SOLR:
    Depending on how the business wants products indexed there are two options for indexing classification attributes: CommerceClassifcationPropertyValueProvider - Indexes an attribute associated to the classification class. See electronics solr for an example - Mega Pixel is faceted against class picture quality ClassificationPropertyValueProvider - creates a facet on the attribute regardless of the class if belongs too.

    See the example below

    New facet search based on classification attribute
    In order to define Solr facet search based on classificaiton attribute you could customize below snippet to your needs.

    CLASSIFICATION_ATTRIBUTE_CODE links to classification attribute
    SOLR_INDEXED_PROPERTY_TYPE defines type of data which is indexed, can have one of possible values:
    boolean
    int
    string
    sortabletext
    text
    float
    double
    date
    FACET_TYPE defines how we will filter results based on the facet selection
    Refine - exactly one selection
    MultiSelectOr - sums results
    MultiSelectAnd - make sense only for multivalued fields, filters results that contains all selections
    FACET_SORT defines how values will be sorted
    Alpha - alphanumerically
    Custom - possibility to link sort to spring bean that will calculate value used to order
    PRIORITY defines order in which facet appears, bigger the number, higher facet appears (to have facet visible value must be bigger than 0)
    SOLR_RANGE links to ranges definition that will be used to group common results
    CLASSIFICATION_CLASS_CODE:::CLASSIFICATION_ATTRIBUTE_CODE:::: - exactly in this format defines link between solr property and classification attribute value

    projectdata_11.importSolr.impex
    # Define macros needed to select proper classification system
    $classificationCatalog=trainingClassification
    $classSystemVersion=systemVersion(catalog(id[default='$classificationCatalog']),version[default='1.0'])
    $classCatalogVersion=catalogVersion(catalog(id[default='$classificationCatalog']),version[default='1.0'])
    $classAttribute=classificationAttribute(code,$classSystemVersion)
    $classClass=classificationClass(code,$classCatalogVersion)
    $classAttributeAssignment=classAttributeAssignment($classClass,$classAttribute,$classSystemVersion)

    INSERT_UPDATE SolrIndexedProperty;solrIndexedType(identifier)
    [unique=true];name[unique=true];type(code);sortableType(code);currency[default=false];localized[default=false];multiValue[default=false];facet[default=false];facetType(code);facetSort(code);priority;fieldValueProvider;customFacetSortProvider;rangeSets(name);$classAttributeAssignment #;$solrIndexedType;CLASSIFICATION_ATTRIBUTE_CODE;SOLR_INDEXED_PROPERTY_TYPE;;;;;true;FACET_TYPE;FACET_SORT;PRIORITY;commerceClassificationPropertyValueProvider;;SOLR_RANGE;CLASSIFICATION_CLASS_CODE:::CLASSIFICATION_ATTRIBUTE_CODE::::
    ;$solrIndexedType;puzzlePieces;string;;;;;true;Refine;Alpha;1000;commerceClassificationPropertyValueProvider;;;puzzles:::puzzlePieces::::
    ;$solrIndexedType;puzzlePieceSize;string;;;;;true;Refine;Alpha;900;commerceClassificationPropertyValueProvider;;;puzzles:::puzzlePieceSize::::

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks Zardini, So can you tell me which is the better approach among these - going with our design (where all product attributes and values are defined in impex as a collection and assigning it to product) or classification system. 1) How can we implement solr if we go with the design which i've shared, as the attributes are not predefined , how to index these dynamic attributes. 2) can i leverage OOTB code if go with my generic design or will i face any problems in future implementations.

      Please advise.

      Thanks, Sandeep

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2015 at 11:06 AM

    Do you have reasons why you don't want to use classification?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.