The SpellCheck component

One of the best ways to enhance the search experience is by offering spelling corrections. This is sometimes presented at the top of search results with such text as "Did you mean ...". Solr supports this with the SpellCheckComponent.

Note

A related technique is to use fuzzy queries using the tilde syntax. However, fuzzy queries don't tell you what alternative spellings were used; the case is similar for phonetic matching.

For spelling corrections to work, Solr must clearly have a corpus of words (a dictionary) to suggest alternatives to those in the user's query. "Dictionary" is meant loosely as a collection of words, and not their definitions. Typically, you configure an appropriately indexed field as the dictionary or ...

Get Apache Solr Enterprise Search Server - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.