On 3/11/2015 3:35 PM, tuxedomoon wrote:
> I can definitely upgrade to SolrJ 4.x and would prefer that so as to target
> 4.x cores as well.  I'm already on Java 7. 
> 
> One attempt I made was this
> 
>     UpdateRequest updateRequest = new UpdateRequest();
>     updateRequest.setParam("collection", collectionName);
>     updateRequest.setMethod(SolrRequest.METHOD.POST);
>     updateRequest.add(solrdoc);
>     UpdateResponse updateResponse = updateRequest.process(solrServer);
> 
> but I kept getting Bad Request which I suspect was a SOLR/SolrJ version
> conflict.  
> 
> I'm all ears!

Can you share the full stacktrace?  If you can't see it on the client,
grab it from the server log.

The "collection" request parameter is only useful if you're running
SolrCloud.  The 3.x version and 4.x/5.x in non-cloud mode should ignore it.

UpdateRequest objects are created by default with a POST method, you
don't need to include that.

When I have some time to actually work on the code, I'm going to write
it using 4.x classes because that's what I have immediate access to, but
if you do 5.x, SolrServer becomes SolrClient, and HttpSolrServer becomes
HttpSolrClient.  I think everything else will be the same.  If I'm wrong
about that, it very likely will not be very hard to fix.

Thanks,
Shawn

Reply via email to