Configuring category-based search relevancy

Use the category-based search relevancy feature to boost or filter products that display to shoppers on the Search Results page.

The search merchandiser can use category-based search relevancy feature to create results that more closely matches the shopper's expectation.

Consider a department store that sells notebooks. There are some notebooks in the Stationary category and many notebook computers in the Electronics category. There are a few films in the Movies category that have the term notebook in the short description. Finally, the Books category has some books with the term notebook in the title. Before you implemented the category-based search relevancy feature, a shopper who searched for notebook sale would see results from all four categories, and other categories that contain products with the word sale indexed. From the shopper's perspective, the results might be grouped in an unexpected way.

The search merchandiser can improve the search results by boosting or filtering.
  • Boost products to show products from a specific category first.

    For example, if the shopper searches for notebook sale show search results from the Electronics category, then show results from other categories.

    How to implement:

    • Developer: Set the relevancyType=1 property in the component configuration file, wc-component.xml.
    • Search merchandiser: In the Catalogs tool Electronics category Change Category page Keyword field, add the term notebook. Do not add this keyword to any other category.
  • Filter products to show results from specific categories.

    For example, if the shopper searches for notebook sale show search results from the Electronics, Stationary, and Movies categories. Do not show products from any other categories.

    How to implement:

    • Developer: Set joinFilterQuery to true in the wc-search.xml file.
    • Search merchandiser: In the Catalogs tool Change Category page Keyword field, add the term notebook for the Electronics, Stationary, and Movies categories. Do not add this keyword to any other categories. Products within the three categories are searched. The returned products contain indexed fields that have the text notebook, or sale.
Limitations
  • Category-based search relevancy does not support multiple search terms. That is, both commas and spaces are treated as separators in the search query. For example, if any of a customer's search terms are found in multiple categories, all categories containing the search terms will be searched.
  • Category-based search relevancy does not support the Specify Top Search Result search rule action.
  • The keyword field does not distinguish between the master and sales catalogs. If you add a keyword to the master or sales catalog, it will appear be filtered regardless of the catalog you are searching. To avoid having keywords affect each other, create a separate sales catalog for the keyword, so that they are considered separate.

Procedure

  1. Enable and work with the category-based search relevancy feature by setting properties in the extended catalog component configuration file (wc-component.xml) on the Search EAR:
    1. Open the extended catalog component configuration file on the Search EAR for editing.
      • Search_eardir/xml/config/com.ibm.commerce.catalog-ext/wc-component.xml
    2. Define the following property to enable the feature:
      <_config:property name="relevancyType" value="1" />
        
    3. Define a boost factor value for the categoryBasedSearchRelevancyBoostFactor property.

      For more information about setting values in the file, see Changing properties in the component configuration file (wc-component.xml) (Search EAR).

  2. Enable and work with the category-based search relevancy feature by setting properties in the extended search configuration file (wc-search.xml) on the Search EAR:
    1. Open the extended search configuration file on the Search EAR for editing.
      • Search_eardir/xml/config/com.ibm.commerce.catalog-ext/wc-search.xml
    2. Review the category-based search relevancy properties in the WebSphere Commerce Search configuration file (wc-search.xml).
    3. Define values for the following properties:
      • joinFilterQuery
      • CatalogGroupSearchFields

      For more information about setting values in the file, see Changing properties in the component configuration file (wc-component.xml) (Search EAR).

    4. If you have enabled the search result grouping feature, you must include all other profiles that extend the IBM_findProductsBySearchTerm profile for the features to correctly work together:
      
      <_config:profile name="IBM_findProductsBySearchTerm" indexName="CatalogEntry">
         <_config:join>
            <_config:param name="joinFilterQuery" value = "true" />
            <_config:param name="CatalogGroupSearchFields" value="keyword, name" />
         </_config:join>
      </_config:profile>
      
      <_config:profile name="IBM_findProductsBySearchTerm_grouping" extends="IBM_findProductsBySearchTerm">
      <_config:profile name="IBM_findProductsByNameOnly" extends="IBM_findProductsBySearchTerm">
      <_config:profile name="IBM_findProductsByNameAndShortDescriptionOnly" extends="IBM_findProductsBySearchTerm">
      <_config:profile name="IBM_findProductsByUnstructureOnly" extends="IBM_findProductsBySearchTerm">
      
  3. If you are using sales catalogs, complete this step to ensure that products within a sales catalog do not appear in search results in the master sales catalog:
    1. Open the solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/wc-data-config.xml file for editing.
    2. Remove all instances of the following code snippet:
      
      <field column="categoryname" splitBy=";" sourceColName="CATGRPNAME" />
      
    3. Save your changes and close the file.
    4. Preprocess and build the search index.
    5. Update the extended catalog component configuration file (wc-component.xml) on the Search EAR to include the following configuration:
      
                <_config:extendedconfiguration>	
      	 <_config:configgrouping name="SearchConfiguration">
               <_config:property name="relevancyType" value="1"/>         
               <_config:property name="categoryBasedSearchRelevancyBoostFactor" value = "100"/>         
            </_config:configgrouping> 	 	
           </_config:extendedconfiguration>
      
    6. Update the extended search configuration file (wc-search.xml) on the Search EAR to include the following configuration:
      
               <_config:profile name="IBM_findProductsBySearchTerm" indexName="CatalogEntry">
      	<_config:join>
      	<_config:param name="CatalogGroupSearchFields" value= "name" /> 
      	</_config:join>
           </_config:profile>
      
    7. Restart the search server.
  4. Optional: Increase the size of the CATGRPDESC table KEYWORD column.

    The category-based search relevancy feature uses the CATGRPDESC.KEYWORD to store product-category mappings. This column is defined as column VARCHAR(254). If you require more space, increase the size of the column. You must also modify the wc-data-config.xml file.

  5. Business users: Update category descriptions to include keyword data by using either the Catalogs tool or the Data Load utility: