Refactored and self-contained plugin to support Solr 4 as the search engine.