Basic interface to Apache Solr (Python recipe)

Basic interface to Apache Solr (Python recipe) by Graham Poulter.

From the post:

A basic model class representing Apache Solr. Abstracts the select, delete, update, and commit operations.

Select operation returns Python object parsed from a JSON-formatted response.

(code omitted)

There are several full-fledged Python libraries for interfacing to Apache Solr.

But sometimes all you need is a little code to build an appropriate HTTP request and parse the response. In that case, using this class could save you some time.

I think recipes are a good thing. What I have found in cooking is that at first I follow them closely until I gain confidence with the techniques and the likely result. The longer I use them the more I am likely to depart from them. So I get, usually, an edible result and learn something in the bargain.

I think there is a lesson here for teaching people about semantic and data mining techniques in general and topic maps in particular.

Leave a Reply

You must be logged in to post a comment.