Implement suggestions
Solr can be configured to support suggestions while typing. Note that the current Solr implementations loads suggestions in memory, which can result in a large memory footprint if you have many unique terms (you could then also choose to load the suggestions only for the title field instead of for the default search field, normally containing all indexed text)
First of all, you need to configure the suggest in the solrconfig.xml:
Enable suggest in solrconfig.xml:
Now, in your java code, you can use assuming we send a http request with the partial typed query as for exmaple ?suggestquery=hip
and the JSP snippet. note that the collated var contains the auto suggested terms for every separate term in the suggestquery. For example if you have ?suggestquery=hipp cm , then the collated result might be for example hippo cms