If you are using .NET 5 or .NET 2, you must also add one these lines in the example below
keyotiSearch.setServiceType('core'); //for .NET 5
keyotiSearch.setServiceType('asmx'); //for .NET 2
The default result header template will display spelling suggestions for misspelled search queries.
...
<div id="sew_resultHeader">
<div id="sew_headerTEMPLATE" class="sew_header">
Showing result page <b>${PageNumber}</b>.
There are <b>${NumberOfResults}</b> results for <b>“${Query}”</b>.
<span id="sew_ignoredWords">The following common words were ignored: ${IgnoredWords}</span>
<div id="sew_didYouMean">Did you mean: <a href="#stayhere"
onclick="keyotiSearch.search(\'${SuggestedSearchExpressionEscaped}\', 1)">${SuggestedSearchExpression}</a></div>
</div>
</div>
...
It is important to wrap the 'did you mean' section with an element with id sew_didYouMean, because this element is automatically made invisible if there are no misspelled words.
${SuggestedSearchExpressionEscaped} is a Javascript safe string (ie. escaped quotes) containing the corrected search query.
${SuggestedSearchExpression} is the corrected search query.
Download and unzip the .dict file(s) required and place it in a folder under the Index Directory called "Dictionaries" (creating if need be). For example - myApp\IndexDirectory\Dictionaries\DICT-DE-DE-German_SE.dict. The dictionary files must not be renamed, as their language is determined from the filename.
Multiple global dictionaries are available for free download, once installed a language can be selected using the keyotiSearch.language property.
keyotiSearch.language = "EnglishUS";
Valid language strings are as the values defined in the enum Keyoti.SearchEngine.Suggestions.LanguageType: Danish, Dutch, English, EnglishAustralia, EnglishCanada, EnglishMedical, EnglishUK, EnglishUS, French, German, Italian, Norwegian, Polish, Portuguese, Spanish, SpanishLatinAmerica, Swedish, Russian, Custom
When set to "Custom" the spell checker will attempt to load a dictionary file under the Dictionaries folder named DICT-X-X-Custom_SE.dict
keyoti
keyoti's
rapidspell
Where the spelling suggestions will be sourced, options are defined in the Keyoti.SearchEngine.Suggestions.SpellingSuggestionSource enum (eg. PresetDictionary, SearchLexicon, PresetDictionaryAndOptionalSearchLexicon, PresetDictionaryAndSearchLexicon). Care should be taken with lexicon based options as large lexicons can cause slow downs.
keyotiSearch.spellingSuggestionSource = "PresetDictionary";