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. 69Gone 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.
Hi, Siva! Thanks for your posts about SOLR Suggestions – I got some bricks from them for understanding the whole picture.
I have a requirement, which do not know yet how to implement better, maybe you could help me? I need the possibility to show the top categories where the suggestion could me met – like on your picture:
[god of war in Games]
[godfather in Books]
[godfather in Posters]
[god of small things]
[…]
Which is the best option to implement this in one query?
Sorry for the late reply. You can use this approach https://smarttechie.org/2013/08/17/auto-complete-suggestions-implementation-using-apache-solr-approach3/ . If you want to present the categories, index the category name as well. So that the search text will be used to match the string, then we can present the associated category name.
Will it works on Solr 4.10 ?
Solr 4.10 has built in auto suggestions component. You can use that. Still, this approach may work. I will confirm after testing it on Solr4.10
Will it work on Solr 4.10 ???
Solr 4.10 has built in auto suggestions component. You can use that. Still, this approach may work. I will confirm after testing it on Solr4.10
Wil it work in Solr 4.10 ?
Solr 4.10 has built in auto suggestions component. You can use that. Still, this approach may work. I will confirm after testing it on Solr4.10
Will it work for solr 3.6.2?
Yep. This should work for Solr 3.6.2 also.
Very good explanation. Thanks for your effort.
Nice Explanation.. thanks