Skip to main content
Help us improve Python packaging – donate today!

Minimalistic interface to Solr.

Project Description

This is a very simple Solr interface for Python.

Installation

`bash $ pip install sunny `

Usage

Create your Solr connection (actually a pool of connections) and then pass query parameters using simple dictionaries. The raw Solr result is returned as a Python dictionary.

`python >>> import sunny >>> solr = sunny.Solr('http://localhost:8080/solr') >>> solr.query({'q': 'office', ...             'facet': 'on', ...             'facet.field': ['network', 'runtime']}) {u'responseHeader': {u'status': 0, u'QTime': ... `

Parameters

Solr parameters are passed as dictionaries where every value may be either a string or a list of strings.

wt=json is passed with every request no matter what, because JSON is easy to convert to Python objects.

Example:

`python >>> import sunny >>> solr = sunny.Solr('http://localhost:8080/solr') >>> solr.query({'q': 'office', ...             'facet': 'on', ...             'facet.field': ['network', 'runtime']}) {u'responseHeader': {u'status': 0, u'QTime': ... `

The above is equivalent to this query string: ?wt=json&q=office&facet=on&facet.field=network&facet.field=runtime

If the orderedmultidict package is installed, you may use omdict instances instead of dictionaries.

License

BSD

Release history Release notifications

This version
History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
sunny-0.0.4.zip (5.8 kB) Copy SHA256 hash SHA256 Source None Jul 15, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page