solrbanana

Saving to solr from banana 1.5?


When should a POST request turn into an an OPTIONS request, and what does that mean? What does the end server see in that case?

I'm trying to get the Save-to-Solr feature of banana working, and failing with a status code of 404. I think this is a CORS problem, but am not sure where to go with it.

Running banana 1.5 as a standalone war in tomcat7 and talking to solrCloud. SolrCloud was (I believe) set up for CORS. Queries for data in the dashboard itself are properly returning data. The collection for banana-int is running on the same server as the collection for logdata.

Having trouble inspecting the POST data from Chrome's Inspect-Element, but stepped through the angular, caught the $http.post(path, data, config), turned this into a command-line POST, and that succeeded in putting the dashboard into Solr. Once the dashboard is manually in Solr, I can then load it from Banana. This tells me things (server url, collection, etc) are wired up correctly from the banana/js perspective.

Chrome screenshot


Solution

  • This is most likely due to CORS. AngularJS is sending pre-flight OPTIONS request specifying Access-Control-Request-Method: POST in header which tells the server that the upcoming method is POST.

    For hints about enabling CORS on Solr, check here: here