Enabling and working with auto suggestions
Before you begin
- Install APAR JR50682 to enable this feature.
- Set up the WebSphere 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.
- Update the catalog component configuration file (wc-component.xml)
on the Search EAR. Add the following property under
extendedconfiguration
, with theconfiggrouping
properties:
For more information, see Changing properties in the component configuration file (wc-component.xml) (Search EAR).<_config:property name="LimitKeywordSuggestionsToStoreAndCatalog" value="true" />
- 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
- 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>
- Save and close the files.
- 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:- Update the Solr schema file (schema.xml)
for the CatalogEntry core:
- solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/schema.xml
- 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"/>
- Save and close the file.
- 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:- Open the Store Management tool and select your store.
- In the Catalog tab, select Suggest keywords on search fields.
- 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.
- Update the catalog component configuration file (wc-component.xml)
on the Search EAR. Add the following property under
- 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:
For more information, see Solr Wiki: Analyzers, Tokenizers, and Token Filters: solr.ShingleFilterFactory.<filter class="solr.ShingleFilterFactory" outputUnigrams="true" minShingleSize="2" maxShingleSize="3" tokenSeparator=" " fillerToken="" />
- 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:
- Open the Store Management tool and select your store.
- In the Catalog tab, select Suggest products on search fields.
- Save your changes.