Feature Pack 7 or later

Enabling and working with auto suggestions

Enable and work with auto suggestions so that you can change the scope and types of auto suggestions that appear in the storefront search field.

Before you begin

  1. Install APAR JR50682 to enable this feature.
  2. Set up the WebSphere Commerce search index to apply the relevant templates and schema.

Procedure

  • Feature Pack 7 or laterConfiguring 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 component configuration file (wc-component.xml) (Search EAR).
    2. Update the Solr configuration file (solrconfig.xml) and its workspace version for the CatalogEntry core:
      • solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/solrconfig.xml
      • solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/solrconfig-workspace.xml
      For more information, see Search configuration properties in the Solr configuration file (solrconfig.xml).
    3. Uncomment the following configurations:
      • <str name="update.chain">wc-conditionalCopyFieldChain</str>
        
      • <updateRequestProcessorChain name="wc-conditionalCopyFieldChain">
        <processor class="com.ibm.commerce.foundation.internal.server.services.search.index.solr.ConditionalCopyFieldProcessorFactory">
        <bool name="enabled">true</bool>
        <str name="sourceField">name,shortDescription,keyword,nameOverride,shortDescriptionOverride,keywordOverride</str>
              <str name="targetField">spellCheck</str>
              <lst name="conditions">
                 <str name="published">1</str>
                 <str name="buyable">1</str>
              </lst>
        </processor>
           <processor class="solr.LogUpdateProcessorFactory" />
           <processor class="solr.RunUpdateProcessorFactory" />
        </updateRequestProcessorChain>
        
    4. Save and close the files.
    5. Restart the search server and fully preprocess and build the search index.
      Note: If you also intend to disable generic keyword suggestions in the following steps, you can skip this step at this point, and do so after disabling generic keyword suggestions.
    After you enable specific keyword suggestions, generic keyword suggestions are no longer used. Therefore, next you can disable generic keyword suggestions:
    1. Update the Solr schema file (schema.xml) for the CatalogEntry core:
      • solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/schema.xml
    2. Comment out the following copy field statements:
      
      <copyField source="name" dest="spellCheck"/>
      <copyField source="shortDescription" dest="spellCheck"/>
      <copyField source="keyword" dest="spellCheck"/>
      
      <copyField source="nameOverride" dest="spellCheck"/>
      <copyField source="shortDescriptionOverride" dest="spellCheck"/>
      <copyField source="keywordOverride" dest="spellCheck"/>
      
    3. Save and close the file.
    4. 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.

  • Changing the number of suggested search terms.
    The maximum number of suggested search terms is set to 3 by default. This value is configured as the maxShingleSize in the schema.xml file:
    
    <filter class="solr.ShingleFilterFactory" outputUnigrams="true" minShingleSize="2" maxShingleSize="3" tokenSeparator=" " fillerToken="" />
    
    For more information, see Solr Wiki: Analyzers, Tokenizers, and Token Filters: solr.ShingleFilterFactory.
  • Feature Pack 8Configuring 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.