This chapter covers
- Spell-checking
- Suggesting query terms
- Implementing a predictive instant search experience
- Suggesting queries based on past user activity
In this chapter, we introduce two simple features to help improve the usability of your search solution. Specifically, we cover spell-checking and autosuggest. Spell-checking addresses the problem of misspelled query terms, leading to poor search results. You’ve probably seen an incarnation of spell-checking when using your favorite web search engine and it asks, Did you mean ...? Spell-checking is a crucial feature for helping users who don’t take the time to craft perfect queries, especially in mobile environments.
Autosuggest helps users as they type by providing instant suggestions from terms in your index; it allows users to quickly hone in on query terms as they formulate their query. Autosuggest gives immediate feedback to users by showing valid query terms available in the index as they type. Let’s begin by learning how Solr’s spell-check search component works, as that provides the foundation for autosuggest.
In this section, you’ll learn how to use Solr’s spell-check search component. Automated spell-checking is a core search feature that most users expect to just work without having to think. When it comes to spell-checking, there are four general scenarios you need to consider: