#Solr suggester example download
To start things off download and start the example Solr Its a lot easier to understand if you have an example in hand. By specifying facet.prefix, the facet values will be constrained to only those values that start with the stated prefix. Fortunately, theres is a less commonly used parameter that fixes our problem: facet.prefix. However the values remaining in the field may start with any letter of the alphabet. Whats more, the user can type these terms in and be guaranteed to find results.īut theres one small matter, to contend with – Ideally, you would want the suggestions to complete the word that you user is currently typing. When the user makes a query, a list will be returned that contains all the words that exist in the remaining documents sorted by count. Now consider what happens if you include a text field as a faceted field. Additionally, the facet values are sorted according to the number of documents associated with that value. The only facet values displayed will be those values that are consistent with the current search results.
![solr suggester example solr suggester example](https://i.vimeocdn.com/filter/overlay?src0=https:%2F%2Fi.vimeocdn.com%2Fvideo%2F564105058_1280x720.jpg)
As the search results change, consider what is happening to your facets.
![solr suggester example solr suggester example](https://www.drupal.org/files/Step_4_3.png)
Additionally, you may add any number of filter queries fq to further constrain the search results. Heres how: Facet Based SuggestionsĪs your user searches through your inventory, the Solr query q parameter will constantly be changing. – Why not use a solution that is based upon the normal, out-of-the-box Solr setup. (Please someone tell me if Im wrong!) In any case, getting the suggester working takes a bit of configuration.
![solr suggester example solr suggester example](https://lucidworks.com/wp-content/uploads/2015/03/browse_techproducts-1024x624.png)
Rather, it is based upon a dictionary lookup that is agnostic of what the user is currently searching for. However I havent found a way to configure the suggester so that it suggests only completions that that correspond to search results.
#Solr suggester example full
If you make a suggestion of a word just because it is somewhere in your index, but it is inconsistent with the other terms that the user has typed, then the user is going to get a results page full of white space and youre going to get another dissatisfied customer!Ī lot of search teams jump at the Solr suggester component because, after all, this is what it was built for. When you make these suggestions, it is critical to make sure that your suggestion leads to search results. Part of this is by making term suggestions as they type. And it is your goal to be as helpful as possible. Heres the use case: A user comes to your search-driven website to find something. In this post Ill cover a closely related functionality called Suggest-As-You-Type. In my previous post, I talked about implementing Search-As-You-Type using Solr.