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.
Note: 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
- 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.
- The ATTR_ID column of ATTRDICTSRCHCONF is automatically
updated when a business user makes an attribute searchable, facetable, or Use 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,
facetable, or
Use 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.
- The ATTRNAME column of CLSATTRSRCHCONF must be manually
updated based on the language_id being used.
- Update your storefront facet data.
Facet
data is located in the following database tables:
- Mark the attribute as searchable, facetable, or Use in merchandising using
the Management Center Attribute Dictionary tool. This gives the attribute
an ATTR_ID in the ATTRDICTSRCHCONF table.
- 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');
- 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
.
- Insert 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);
- Insert a new record into the FACETDESC
table. For example:
insert into FACETDESC values(1001, -1, 'Size', 'classic attribute size', null, null, null, 0);