In the previous articles, we have seen the auto-suggests setup with Apache Solr. In these days, the user experience has changed a lot and the way the sites are presenting the auto-suggestions to the user is also changed. Most of the web sites are not presenting auto suggestions as simple text messages. For example, if you are searching for a movie DVD, they are suggesting film names, along with that they are displaying the thumbnail image of DVD poster, the short description, the cast acted in that movie. So, the user is going to get more information from the auto-suggestions. In the below picture, the suggestions contain popular products with image, price and the movie name.
If we want to provide the information what we are seeing in the above picture, we need to enhance the configuration which we have done in PART-1 or PART-2. In this example, we are using the sample movie database and the data is available here.
The analysis configuration provided in the schema.xml is given below.
The fields configuration provided in the schema.xml is given below.
If you perform a search operation for “win” keyword and the response is giving the movie names along with thumbnail image and the short description of the film. The sample response is given below.
0 94 name:"win" Rear Window (1954) A visceral black-and-white drama about an aging boxer (Robert De Niro), Martin Scorsese's 1980 flick is one of the best of its decade. 69 Gone With The Wind (1939) Victor Fleming's 1939 star-studded Civil War tour de force finds Clark Gable and Vivien Leigh entangled in a fiery love affair. 34
The configuration used in this article is available here. We have seen different variations of setup for auto-suggestions using Apache Solr. Now, you can implement any of these in your applications.