awead/solr_ead — pull request #1 by barnabyalter (2013-04-22 19:17:05+00:00)
Title: Updated Indexer to accept SOLR_URL; Changed rake tasks to accept CUSTOM_DOCUMENT arg

Not sure if this is functionality you desire but it's something I had to build in locally and it might prove useful to others. Here's what I've done:

* `Indexer.new` - Looks for `ENV['SOLR_URL']` to instantiate the RSolr url. This is so crons can run the indexer from the shell environment rather than the Rails environment. For example, for a WebSolr instance do:

rake solr_ead:index_dir DIR=path/to/eads SOLR_URL=http://index.websolr.com/apikey/select

* Initialize can also now read ERB from the solr.yml file.
* Rake tasks `solr_ead:index_dir` and `solr_ead:index` can take `ENV['CUSTOM_DOCUMENT']` to instantiate an indexer with a custom document. So

rake solr_ead:index FILE=path/to/ead CUSTOM_DOCUMENT=lib/custom_document.rb

will translate to

indexer = SolrEad::Indexer.new(:document=>CustomDocument)