Adding catalog entry properties to search rule actions or targets
Search rule actions and targets in the Management Center dynamically populate a list of catalog entry indexed properties. You must customize HCL Commerce search when you are adding new indexed catalog entry properties to search rule actions or targets.
property
are read-only once saved.Procedure
-
Register the new indexed catalog entry property in the SRCHATTR table:
Where 'INSERT INTO srchattr (SRCHATTR_ID, INDEXSCOPE, INDEXTYPE, IDENTIFIER, OPTCOUNTER) VALUES (10001, '0', 'CatalogEntry', '_cat.fieldname', 0);
_cat.fieldname
' is the search index field name that you want to add. This field name must be prefixed with '_cat.
' to identify the object as a search attribute.In the following examples, the field namecustomerRanking
is used as the identifier for a sample catalog entry property. ThecustomerRanking
property is used as a sample catalog entry property to demonstrate the steps in this topic only; by default, this property does not exist for any catalog entry and there is no logic that is associated with this sample property.INSERT INTO srchattr (SRCHATTR_ID, INDEXSCOPE, INDEXTYPE, IDENTIFIER, OPTCOUNTER) VALUES (10001, '0', 'CatalogEntry', '_cat.customerRanking', 0);
-
Specify the usage and data type of the property in the SRCHATTRPROP
table.
Depending on the catalog entry property data type and usage, different
PROPERTYNAME
values must be used. The usage results in populating the indexed catalog entry properties in different search rule action or target grids. The type results in populating different matching rules in each of the search rule action or target grids.The following table shows the supported usage and data types for catalog entry properties:Supported usage and data types for catalog entry properties Property Data type Usage merchandising-Filter-ExactText
Single words or phrases such as Manufacturer Name. Catalog Entry properties with these usage-types are used in the Recommend Catalog Entry, and Add or Replace Search Criteria actions filter grid. merchandising-Filter-AnyText
Sentences or multiple words. Such as name and short description. merchandising-Filter-Numeric
Decimal numbers or whole numbers. Such as Customer ranking. merchandising-Rank-ExactText
Single words or phrases such as Manufacturer Name. Catalog Entry properties with these usage-types are used in the Change Search Result Order ranking grid. merchandising-Rank-AnyText
Sentences or multiple words. Such as name and short description. merchandising-Rank-Numeric
Decimal numbers or whole numbers. Such as Customer ranking. merchandising-Facet-ExactText
Single words or phrases such as Manufacturer Name. Catalog Entry properties with this usage-type are used in the Search Criteria and Result target, search criteria grid. merchandising-Sort-Text
All text including single words, phrases, or multiple words such as Manufacturer Name. Catalog Entry properties with this usage are used in the Recommend Catalog Entry, and Add or Replace Search Criteria actions sorting grid. merchandising-Sort-Numeric
Decimal numbers or whole numbers. Such as Customer ranking, offer price. For example, to add a samplecustomerRanking
catalog entry property to the Change Search Result Order action ranking grid, the usage is Rank and the data type is Numeric.INSERT INTO srchattrprop (SRCHATTR_ID, PROPERTYNAME, PROPERTYVALUE, OPTCOUNTER) VALUES (10001, 'merchandising-Rank-Numeric', 'customerRanking', 0);
-
Specify the display name of the added indexed catalog entry property in the SRCHATTRDESC table:
Where displayname is the search index field name you want to add.INSERT INTO srchattrdesc (SRCHATTR_ID, LANGUAGE_ID, DISPLAYNAME, DESCRIPTION) VALUES (10001, -1, 'displayname', null);
For example,INSERT INTO srchattrdesc (SRCHATTR_ID, LANGUAGE_ID, DISPLAYNAME, DESCRIPTION) VALUES (10001, -1, 'Customer Ranking', null);
When you are adding a property to the SRCHATTRPROP table, you can also add a language-specific name for the property to be displayed in the Management Center into the SRCHATTRDESC table. This is for the search column that is registered in the SRCHATTR table for which you are defining a new purpose in the SRCHATTRPROP table. If no record is added to the SRCHATTRDESC table, the IDENTIFIER is used from the SRCHATTR table.
For example, to add another language display value for thecustomerRanking
indexed catalog entry property:
Where translatedText is the translated text in the language you want to show.INSERT INTO srchattrdesc (SRCHATTR_ID, LANGUAGE_ID, DISPLAYNAME, DESCRIPTION, OPTCOUNTER) VALUES (1001, -2, 'translatedText', null, 0);
- Restart your HCL Commerce server.