Auto-Suggestion (Auto-Complete) Box

For your application, you may have auto-suggest (or call auto-complete) feature in searching field, such as .


When user enters two or more than two characters, it will trigger auto-complete action, and remote lookup external web API, which returning list of data in JSON format.

So, for example, your application can query SOLR using JQuery or other JS, it can return JSON data so that JQuery can show the data on the webpage.

Please find the below SOLR query examples for auto-suggestion:

Requested URL


Parameters Values Details
q name:*king* Auto-suggesting “name” field
fl name Return “name” field only
omitHeader true By default, it is false.

When true, returning JSON will omit the header, you can try the above request with and without omitHeader, and see what is the different.


Requested URL



 Besides using normal search like the first example, you can also use “terms” to lookup the keyword like this example. Please note that it is calling to “terms” request handler instead of “select”.

Parameters Values Details
terms.fl name Return “name” field
terms.prefix ki Lookup terms prefix


Please rate this