Using Handlebars.js To Display Results From Solr- A Primer

Handlebars provides the power necessary to let you build semantic templates effectively with no frustration.

Handlebars.js is a really great way to render search results from Solr.

Handlebars.js has become the defacto standard for templating in JavaScript, filling the void left from the abandonment and non-replacement of the jQuery template project. Handlebars.js is an implementation of the mighty platform-independant mustache project

JavaScript templating makes it a lot easier to implement cool interface functionality on your search result page such as responsive design, autoscrolling and more. Handlebars make JS templating a cinch.

You get the benefit of Handlebars.js on webpages that have a lot of repeating code such as lists, search-results and libraries.

In order to see Solr and Handlebars.js in action click here or copy and paste the code below into an empty .html file.

Article written by

Fergus McDowall
Senior Consultant at Comperio. Dedicated emacs user.

1 response to: «Using Handlebars.js To Display Results From Solr- A Primer»

  1. July 26, 2013 at 17:42 | Permalink

    Hi Fergus,
    I tried your code, It’s not working.


Leave a response

XHTML: These tags are allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">


Comperio AS
Øvre Slottsgate 27
NO-0157 Oslo,
+47 22 33 71 00
View map


Search Provider Sverige AB
Gamla Brogatan 34
SE-11 120 Stockholm
+46 8-21 49 00
View map