HCL Commerce Version 9.1.7.0 or later

Customizing spell check correction suggestions

One of the key factors in improving shoppers' search experience at the storefront is understanding what exactly shoppers are looking for, and displaying the relevant search results. Sometimes shoppers can create typos while searching for the products or services at the storefront. Such errors do not end up displaying the relevant search results, negatively impacting their search experience at the storefront. In such cases, having a robust spell check in place can enhance the search experience by providing appropriate suggestions for the misspelled search queries. HCL Commerce Search provides you the ability to customize spell check correction suggestions as per your business needs. This means you can customize the spell check correction suggestions that are displayed at the storefront in case of misspelled search queries.

How to customize spell check correction suggestions

You can customize the spell check correction suggestions with the help of the following configurable parameters based on which the HCL Commerce Search fetches appropriate spell check correction suggestions at the storefront.

Configurable parameters in wc-component.json

Configure the values of the following parameters as per your business needs:
Parameter name Description Default value
SpellCheckAccuracy The similarity of the suggested terms. How similar the suggested terms at least need to be compared to the original suggest text tokens. A value between 0 and 1 can be specified. 0.3
SpellCheckPrefixLength Refer to prefix_length option description in the Elasticsearch documentation. 2
SpellCheckSuggestionMode Refer to suggest_mode option description in the Elasticsearch documentation. MISSING
SpellCheckSortBy Refer to sort option description in the Elasticsearch documentation. SCORE
SpellCheckStringDistance Refer to string_distance option description in the Elasticsearch documentation. INTERNAL
SpellCheckMaxEdits Refer to max_edits option description in the Elasticsearch documentation. 2
SpellCheckMaxInspections Refer to max_inspections option description in the Elasticsearch documentation. 5
SpellCheckMaxTermFrequency Refer to max_term_freq option description in the Elasticsearch documentation. 0.01
SpellCheckMinWordLength Refer to min_word_lengthoption description in the Elasticsearch documentation. 4
SpellCheckMinDocFrequency Refer to min_doc_freq option description in the Elasticsearch documentation. 0.0

Configurable parameters in search profile

Configure the value of the following parameter as per your business needs.
Parameter name Description
"spellcheck": {
			"limit": 
		}
Specifies the number of spell check correction suggestions to be returned at the storefront.
Important: To learn more about search profile, refer to Setting up your custom search profile.

Managing Configuration and Components

HCL Commerce Search supports managing various configurations such as ingest-config, Component, and STA using a flexible REST API. These configurations are used to customize and control different aspects of search behavior per environment.
/search/resources/api/v2/configuration?nodeName={nodeName}&envType={envType}&locale={locale}
Supported HTTP Methods:
  • POST - Add a new configuration.
  • PATCH - Update or append configurations.
  • PUT - Move configurations from the "auth" node to the "live" node.
  • GET - Retrieve existing configurations.
  1. Use the POST method to create a new configuration from scratch.
  2. Use the PATCH method to modify or append values.
    Note: Do not use POST to update configurations, as it will overwrite existing configurations entirely.
  3. Use the PUT method to move configuration resources from the authoring (auth) environment to the live environment.