Changing the relevancy of search index fields
Depending on your store catalog, some search index fields might be more relevant than others for when shoppers search in the store. You can fine-tune the relevancy of search index fields to improve search results that are based on your store catalog. The relevancy can be scoped to either the site level or to the category level.
The following table shows sample relevancy values
assigned to search index fields:
Search index field | Default relevancy value |
---|---|
categoryname |
100.0 |
partNumber_ntk |
15.0 |
mfName |
10.0 |
name |
10.0 |
shortDescription |
5.0 |
shortDesc_suggest |
1.0 |
partNumber_suggest |
1.0 |
name_suggest |
1.0 |
defaultSearch |
1.0 |
Tip: If your business users enter catalog information into the long description
field instead of the short description, you might want to work around this issue by copying the
information into the first few lines of the long description to quickly generate the short
description. Then, boosting is applied accordingly to the short description.
Before you begin
Procedure
-
Run a keyword search in the storefront and identify the search results that you want to
improve.
For example, your catalog might result in displaying more relevant search results lower than you want them to appear.
-
Update the SRCHPROPRELV table and change the
relvalue
for the search field you want to change the relevancy for: - Perform the same keyword search again in the storefront and compare the search results with the initial search results. Continue to update search relevancy values to optimize the search results.
Example
Color
and
Size
attributes at the site level to 10.0
update srchproprelv set relvalue = 10.0
where srchproprelv_id in (select srchproprelv_id from srchproprelv
where indexfield in (select lower(srchfieldname) from attrdictsrchconf
where attr_id in (select attr_id from attr where identifier in ('Color', 'Size'))));
Color
attribute at the
Dresses
category level:- Query the information for colors in your
store:The values are:
The returnedselect attrdict_id, storeent_id from attrdict where storeent_id=asset_store_id
attrdict_id
value is then used in the following query:select * from srchproprelv where indexfield in (select srchfieldname from attrdictsrchconf where attr_id in (select attr_id from attr where identifier in ('Color') and attrdict_id=returned_attrdict_id));
- catalog ID
10001
storeent_id
10051
indexfield
ads_f32
- Query the
catgroup
ID from CATGROUP:
The resultingselect * from catgroup c, storeent s where c.member_id = s.member_id and storeent_id in (select storeent_id from storecat where catalog_id=10001) or storeent_id in (select RELATEDSTORE_ID from storerel where STORE_ID in (select storeent_id from storecat where catalog_id=10001) and STRELTYP_ID=-4) and c.identifier='Dresses';
catgroup
ID is10006
. - Insert the new record into SRCHPROPRELV. For example, to increase the relevance to
10.5
:Note: You must use asrchproprelv_id
value that is less than-10000
, as the upper range is reserved for IBM internal use.insert into srchproprelv (srchproprelv_id, catgroup_id, catalog_id, storeent_id, relvalue, indexfield) values (-10001,10006,10001,10051,10.5,'ads_f32');
select storeent_id from storeent where identifier='identifier';
Note: The preceding relevancy values are loaded by the setupSearchIndex utility. Any updates to the
default relevancy values in the relevancy.properties file must be made before
you run the setupSearchIndex utility.
- Update the relevancy.properties file under WC_installdir\components\foundation\subcomponents\search\config
- The default relevancy.properties file contains the following values:
Where:categoryname=100.0 name,mfName=10.0 shortDescription,longDescription=5.0 ads_f*,adi_f*,adf_f*,defaultSearch=1.0
- Each line contains an index field and its default relevancy value.
- Search index fields are combined by using a comma (
,
) value.
You can change the relevancy value for existing search index fields, or add new search index fields either by using new lines, or adding to an existing line.