Providing Spelling Suggestion

Spelling suggestion can be used to propose corrections to mistyped words in a user’s query. If a search returns no or few results, the application can display a message on the search results page, listing a suggested alternate query. For example, if the user searches for “helo wonderful worlld” and that phrase returns no hits, your application could respond with

Are you searching for “hello wonderful world”?

on the search-results page. To go farther, your application could also provide additional suggested alternates to the user’s keywords:

Are you searching for “hello wonderful world”?

More suggestions: hello, hell, Hilo, word, world, whorl

The suggestions presented to the user are taken from the word indexes of the collections being searched. All suggested keywords can, therefore, be guaranteed to occur in at least one of the collections the user is searching.

 

 
Note   In Version 5.5, spelling suggestion is supported for only single-byte languages.
 

 

To display spelling suggestions to the user, Your application makes calls to the Client C API or the VSearch Java API. To support the spelling suggestion feature, structures must be created when the collection is indexed. To generate these structures, the administrator can use the mkvdk command-line tool, or the administrator can set up a user-defined job (UDJ) to run from the K2 Dashboard. For more information on the required structures, see the Verity Command-Line Indexing Reference. For more information on user-defined jobs, see the Verity K2 Dashboard Administrator Guide.