It’s two months since I started studing Solr 3.5.0 deeply. One thing that I tryed was Solr integration with a template system called Apache Velocity.
Solr comes with an example application called Solritas. It is a set of template files (.vm extension) and a Request Handler configuration of field, range and date facets, terms for suggestion, geographic search and so on.
Solritas is so simple and easy to use that I decided to customize it in two situations.
The first one is a product catalog. A friend of mine has a company and he travels to Asia from time to time in order to buy huge quantities of handcrafted produtcs to sell in Brazil. What I did was to have Solr to index a CSV file (generated by its COBOL system) of all these products and costumize Solritas making it fit my friend’s requirements. The following is the final result of a Solritas remake I did.
The conclusion of customizing Solritas was that it’s very easy and simple. You can really do good things with it very, very, very fast.
I had no doubt It’s possible to put such projects live. But of course there are some extra work to be considered before doing it.
There was a discussion on Solr user discussion group (email@example.com) talking about if one should put on production such Solritas. My opinion is that before doing it one should at least have in mind the follwing topics:
- if you are going to use a DIH (Data Import Handler) with a database do not let the database configuration plain in data-config.xml. Let data-config.xml references a jndi of your database config
- in order to restrict access to the Solr admin interface, change authentication configuration in the solr war’s web.xml
- have in mind that Solritas uses a template system (Apache Velocity). It is limited in the way you wont be able to build backend processing with it
- fell free to customize Solritas layout using CSS3, HTML5, ajax and all client side stuff
- consider using and Apache Httpd as a reverse proxy to restrict direct access to your solritas
- if you have a high traffic landing on you Solritas, consider having a Varnish in front of it
Of course all of that will depend on your project’s requirements. At least it would be a good idea to customize Solritas as part of a Lean Startup project.