Introduced in Feature Pack 2

Enabling search facets for common attributes

You can enable search facets for common attributes such as brands or categories, so that the storefront can provide customers with faceted navigation for attributes that are not managed using attribute dictionary.

Feature Pack 5 or laterNote: All common attributes either loaded or bootstrapped have a maximum value of 20. To display more than 20 facets in the storefront, you must use the attribute dictionary to change the Maximum values to display value to a higher number. See Creating attributes in the attribute dictionary for more information.

Before you begin

Ensure that you have completed the following tasks:

Procedure

  1. Update your attribute data.
    Attribute data is located in the following database tables:
    ATTRDICTSRCHCONF
    The mapping table between attribute dictionary attribute identifiers and fields in the search schema. This table is used only for attribute dictionary attributes.
    CLSATTRSRCHCONF
    The mapping table between attribute names and fields in the search schema. This table is used only for attributes.
    1. The ATTR_ID column of ATTRDICTSRCHCONF is automatically updated when a business user makes an attribute searchable, Feature Pack 5 or laterfacetable, or Feature Pack 6 or laterUse in merchandising using the Management Center Attribute Dictionary tool.
      However, the ATTR_ID column of ATTRDICTSRCHCONF is not automatically updated when these attributes are marked as such by not using the Management Center Attribute Dictionary tool.
      Note: Disabling searchable, Feature Pack 5 or laterfacetable, or Feature Pack 6 or laterUse in merchandising does not remove the data in the tables. To remove search facets, update the entry in the ATTRDICTSRCHCONF table by setting ATTR_ID to null, and remove the entry from the SRCHATTR table.
    2. The ATTRNAME column of CLSATTRSRCHCONF must be manually updated based on the language_id being used.
  2. Update your storefront facet data.

    Facet data is located in the following database tables:

    1. Mark the attribute as searchable, Feature Pack 5 or laterfacetable, or Feature Pack 6 or laterUse in merchandising using the Management Center Attribute Dictionary tool. This gives the attribute an ATTR_ID in the ATTRDICTSRCHCONF table.
    2. Insert a new attribute into the SRCHATTR table:
      
      insert into SRCHATTR (SRCHATTR_ID, INDEXSCOPE, INDEXTYPE, IDENTIFIER) values (primary_key, 'master_catalog_id', 'CatalogEntry', 'attr_identifier');
      
      Where:
      primary_key
      An unused key in the SRCHATTR_ID column. You can select the key using the following SQL statement: select max(srchattr_id)+1 from srchattr
      master_catalog_id
      The ID of the master catalog that the attribute belongs to.
      attr_identifier
      The column value in the ATTR.IDENTIFIER prefixed with _cat. For example: _cat.Size.
      The following snippet represents a sample SQL query:
      
      insert into SRCHATTR (SRCHATTR_ID, INDEXSCOPE, INDEXTYPE, IDENTIFIER) values (1000, '10101', 'CatalogEntry', '_cat.Size');
      
    3. Insert a new record into the SRCHATTRPROP table:
      
      insert into SRCHATTRPROP (SRCHATTR_ID, PROPERTYNAME, PROPERTYVALUE) values (srchattr_id, 'facet', 'solr_index_column_name');
      
      Where:
      srchattr_id
      The primary key used in the previous query.
      solr_index_column_name
      The corresponding value in the ATTRDICTSRCHCONF.SRCHFIELDNAME suffixed with _ntk_cs. For example, if the ATTRDICTSRCHCONF.SRCHFIELDNAME column has a value of cas_f1, the value used for this table is cas_f1_ntk_cs.
      The following snippet represents a sample SQL query:
      • Feature Pack 4Feature Pack 2Feature Pack 3
        
        insert into SRCHATTRPROP (SRCHATTR_ID, PROPERTYNAME, PROPERTYVALUE) values (1000, 'facet', 'cas_f1_ntk_cs');
        
      • Feature Pack 5 or later
        
        insert into SRCHATTRPROP (SRCHATTR_ID, PROPERTYNAME, PROPERTYVALUE) values (1000, 'facet-classicAttribute', 'cas_f1_ntk_cs');
        
    4. Feature Pack 5 or laterInsert a new record into the FACET table. For example:
      
      insert into FACET values (1001, null, 1000, 0, 0, 1, 0, 10101, 20, 0.0, null, null, null, 0);
      
    5. Feature Pack 5 or laterInsert a new record into the FACETDESC table. For example:
      
      insert into FACETDESC values(1001, -1, 'Size', 'classic attribute size', null, null, null, 0);