Welcome to mysolr’s documentation!

mysolr was born to be a fast and easy-to-use client for Apache Solr’s API and because existing Python clients didn’t fulfill these conditions.

Since version 0.5 mysolr supports Python 3 except concurrent search feature.

Basic Usage

from mysolr import Solr

# Default connection to localhost:8080
solr = Solr()

# All solr params are supported!
query = {'q' : '*:*', 'facet' : 'true', 'facet.field' : 'foo'}
response = solr.search(**query)

# do stuff with documents
for document in response.documents:
    # modify field 'foo'
    document['foo'] = 'bar'

# update index with modified documents
solr.update(response.documents, commit=True)

References

We would like to thank the following developers their work and inspiration:

Projects that are using mysolr

  • solr_cli : Command line console for Apache Solr.

Fork me on GitHub