Suggested Spelling

Functionality

The suggested spelling functionality within KonaKart is automatically used by the storefront application when a search returns no results. The API call:

public SuggestedSpellingItemIf[] getSuggestedSpellingItems(String sessionId, SuggestedSpellingOptionsIf options) throws KKException

is called with the original search string and it may return an array of SuggestedSpellingItems containing alternative spelling suggestions. The suggestions all exist in the product catalog so by clicking on the suggestion link, one or more products should be returned.

The functionality may be enabled or disabled using the Admin App under Configuration >> Solr Search Engine . You may also control whether spelling correction data is added to Solr for disabled products and for invisible products.

Setup

Setting up the suggested spelling functionality is not totally automatic. The file KonaKart/solr/collection1/conf/solrconfig.xml may need to be modified depending on the number of stores and languages supported.

A search component section and a request handler section needs to be defined for each store / language combination. Our default installation is configured for the store with a store id: "store1" and language codes: "en", "de", "es" and "pt".

The name of the request handler must follow the convention "spell_storeId_languageCode" (e.g. spell_store1_en) since the KonaKart engine will dynamically create this string in order to call the correct request handler depending on the store and language currently being used.

Multiple "Spell Checkers" may be defined by each search component. In the above example, two spell checkers are defined using the solr.DirectSolrSpellChecker class and the solr.WordBreakSolrSpellChecker class.