The autocomplete feature in a search box will predict the words that users want to search for. For example, a user wants to buy Apple iPhone 6S from http://www.amazon.com/. So, when the user starts typing Apple
, before the user finishes typing the first three characters, different products of apple get listed in autosuggest. This speeds up human-computer interactions.
In this recipe, you will learn how to use different index fields with an n-gram analyzer to achieve the autocomplete feature. Sitecore provides an out-of-the-box n-gram analyzer, but we will create our own analyzer based on Lucene to make it better and faster. After learning this recipe, you will also be able to use Sitecore's out-of-the-box analyzers and create your custom analyzers too.