traject-project/traject — pull request #61 by jrochkind (2014-11-20 18:13:22+00:00)
Title: SolrJsonWriter

A very basic SolrJsonWriter see #11.

This adds a gem dependency for httpclient -- is that a problem? It could be done with just Net::HTTP (at possible decreased performance which prob doesn't matter since perf is prob terrible already), but it would be painful.

This does no batching, it just sends an HTTP request per record. Using persistent http connections from HTTPClient might ameliorate (or even entirely eliminate) the perf problems there, but this is not intended as a performative solution.

I manually tested against a live Solr server (including error conditions), in both Jruby and MRI (woohoo). I am not sure the appropriate way to write any useful automated tests, if any. Want to avoid needing a live Solr server in testing. (SolrJWriter just assumes SolrJ actually works, and tests mock out the SolrJ connection. If you mock out the Solr HTTP connection here, there's not a lot left to test).

Feedback?