Managing keyword suggestions

Manage keyword suggestions so that you can change the scope and types of keyword suggestions that appear in the storefront search field.

There are two implementations for keyword suggestions. The native Solr TermsComponent implementation, and the search-based keyword suggestion implementation. The main difference between the implementations is that by default, the Solr TermsComponent suggestions do not consider request scopes such as store, catalog, or other specific filter queries. In contrast, the search-based keyword suggestions can use all the filter query types.
Note: Enable search-based keyword suggestions only if you have a business requirement to do so. There might be noticeable differences in the types of suggestions and response times compared to the native Solr TermsComponent implementation.

Before you begin

  1. Set up the HCL Commerce Search index to apply the relevant templates and schema.

Procedure

  • Configuring keyword auto suggestions to provide relevant suggestions to the store and sales catalog being browsed, and showing only published and buyable catalog entries.

    Keyword suggestions are based on all indexed catalog entries by default. In some cases, when a subset of the master catalog entries is linked to a sales catalog, the keyword suggestions might generate search misses.

    To provide relevant keyword suggestions, use the specific keyword suggestions feature to limit the keyword suggestions. They can be limited to catalog entries in the store and sales catalog being browsed, and showing only published and buyable catalog entries. Doing so eliminates suggestions that originated from different stores and catalogs, and unpublished and un-buyable catalog entries.

    Static rules can be applied at index-time to create store and catalog-specific suggestions that meet simple conditions based on the catalog entry properties. These properties include published, buyable, and catalog entry type.

    1. Update the catalog component configuration file (wc-component.xml) on the Search EAR. Add the following property under extendedconfiguration, with the configgrouping properties:
      
      <_config:property name="LimitKeywordSuggestionsToStoreAndCatalog" value="true" />
      
      For more information, see Changing properties in the HCL Commerce configuration file (wc-component.xml).
    2. Update the Solr configuration file (solrconfig.xml) and its workspace version for the CatalogEntry core using the customizable solrcore.properties file:
      • solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/solrcore.properties
      For more information, see Search configuration properties in the Solr configuration file (solrconfig.xml).
    3. Add the following property: conditionalCopyFieldChain.enable=true.
    4. Save and close the files.
    5. Restart the search server and fully preprocess and build the search index.
    Keyword auto suggestions are enabled only in the Aurora B2C starter store by default. You can enable it in the Aurora B2B starter store with store functions:
    1. Open the Store Management tool and select your store.
    2. In the Catalog tab, select Suggest keywords on search fields.
    3. Save your changes.

    Due to Solr limitations, keyword suggestions include Solr documents that are marked for deletion. To resolve this issue, perform a full index build to clear deleted Solr documents. This eliminates deleted catalog entry suggestions.

  • Configuring product auto suggestions in the storefront.

    Product suggestions can display richer content based on only the shopper's entitled products. Product suggestions use the default field relevancy to provide the most relevant products based on partial matches of the search terms that are used.

    Runtime filtering rules can be used at query time, based on search profile. Therefore, the search profile can be extended by adding other custom providers or processors.

    The product name, short description, part number, and thumbnail are returned by default. However, other fields can also be returned.

    Product auto suggestions are enabled only in the Aurora B2B starter store by default. You can enable it in the Aurora B2C starter store with store functions:

    1. Open the Store Management tool and select your store.
    2. In the Catalog tab, select Suggest products on search fields.
    3. Save your changes.
  • Configuring keyword suggestions to use search-based suggestions.

    The default implementation uses the Solr TermsComponent to perform keyword suggestions. You can override the default implementation by setting the SearchBasedKeywordSuggestions property to true in the catalog component configuration file (wc-component.xml) on the Search EAR.

    The advantage of doing so enables you to have more control over the search scope and search query, since it uses a search profile. You can apply logic to handle catalog filters and entitlement checks, and scope suggestions to the current store and catalog.