UpStart Commerce Search
Spell Correction

Spell Check through Search Request

6min

Spell Check through search requests provides control and flexibility in testing your spell check configurations. You can adjust your spell check configurations directly within your search requests, without the need to change your route, offering a seamless and customizable experience tailored to your specific needs. This feature is particularly useful for testing different configurations before applying them globally.

How It Works

The enhanced Spell Check feature introduces four types of configurations:

  • Auto: This setting utilizes the spell check configuration defined at the Route level. It is the default when no spellCheck parameter is specified.
  • Disabled: If you prefer to disable spell check altogether, you can do so by setting spellCheck: false.
  • Limited: With this option, you can limit the number of spell check results returned while still using the route's spell check configuration. To implement limited spell check results, use the following parameters:
c


Here, you can adjust the limited parameter to specify the desired maximum number of spell check results.

  • Manual: For complete customization, the manual setting allows you to override the spell check configuration defined at the route level and provide your configuration directly in the search request. This option is particularly useful when you need specific spell check settings for individual queries. To utilize manual spell check, use the following parameters:
JS


Here, you can define your custom spell check configuration within the configuration object, including the type of spell check (type) and any additional highlighting preferences.

Example Usage

Let's walk through an example of how to create a route with the desired spell check configuration and then perform a search using the spell check parameters.

1. Creating a Route

Curl


In this example, we've created a route named "Test Route" for the "catalog_live" index with spell check configured to use a Machine Learning-based model.

2. Performing a Search with New Spell Check Parameters

The SITE_ID must be provided to perform spellcheck. Hence, ensure that the SITE_ID is added properly, otherwise, spell check will fail.

Curl


In this example, we're performing a search for the term "pilow" on the "Test Route" we created earlier. The most valuable query contains the term/query that needs to be spellchecked, ensuring the focus is on the correct term for spell check processing.