This is the first time I am using Python and Solr. I have my Solr instance set up within tomcat on GCE. I am trying to connect to it from my Python code using PySolr. However, I am not sure how to send authentication parameters via PySolr.
This is the exception I get:
solr = pysolr.Solr('http://MY INSTANCE IP/solr/News', timeout=10)
Apache Tomcat/7.0.28 - Error report HTTP Status 401 -
type Status report
message
description This request requires HTTP authentication ().
Apache Tomcat/7.0.28
Please advise.
requests
module it's trivial to make HTTP requests with custom headers (likeAuthorization
), read status codes and deal with JSON. So you might be better off to just talk to Solr yourself, and maybe write your own little wrapper module if necessary.grep
it does look likesolrpy
does implement HTTP basic auth though:solr/core.py:426