DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Autosuggest

A user of the search typically want to find the results a fast as possible. To support the user and avoid to much typing solr can create a drop down list of common suggested search terms right after the search input box.

This feature can be easily configured with the following typoscript setting:

plugin.tx_solr.search {
    suggest = 1
    suggest {
        numberOfSuggestions = 10
        suggestField = spell
    }
}

Beside the server related part EXT:solr ships the jQuery autocomplete implementation to show the suggest results.

The suggest implementation uses the devbridge/jQuery-Autocomplete library(https://github.com/devbridge/jQuery-Autocomplete) to render the autocomplete.

If you want to configure an the autosuggest by example, you can include the typoscript example template “(Example) Suggest/autocomplete with jquery”.

When everything is configured the frontend will show you a drop down of suggestions when you are typing in the search field:

../_images/autosuggest.png

Autocomplete with jQuery

Beside search term suggestions the autocomplete an also show you the top search results for the user input.

This feature can be enabled with:

plugin.tx_solr.search.suggest.showTopResults = 1

If you want to change the number of proposed top results you can also configure them:

plugin.tx_solr.search.suggest.numberOfTopResults = 5