parasolr documentation

parasolr is a lightweight python library for Apache Solr indexing, searching and schema management with optional Django integration. It includes a Solr client (parasolr.solr.SolrClient). When used with Django, it provides management commands for updating your Solr schema configuration and indexing content.

  • PyPI version PyPI - Python VersionPyPI - Django VersionPyPI - License
  • Build status Code coverage Documentation Status CodeFactor Maintainability Requirements Status

Currently tested against Python 3.5 and 3.6, Solr 6.6.5, and Django 1.11, 2.0, and 2.1, and without Django.


Install released version from pypi:

pip install parasolr

To install an unreleased version from GitHub:

pip install git+

To use with Django:

  • Add parasolr to INSTALLED_APPS

  • Configure SOLR_CONNECTIONS in your django settings:

        'default': {
        'URL': 'http://localhost:8983/solr/',
        'COLLECTION': 'name',
        # any configSet in SOLR_ROOT/server/solr/configsets
        'CONFIGSET': 'basic_configs' # optional, basic_configs is default
  • Define a SolrSchema with fields and field types for your project.

  • Run solr_schema manage command to configure your schema; it will prompt to create the Solr core if it does not exist.


The SolrSchema must be imported somewhere for it to be found automatically.

Development instructions

This git repository uses git flow branching conventions.

Initial setup and installation:

  • Recommmended: create and activate a Python 3.6 virtualenv:

    python3 -m venv parasolr
    source parasolr/bin/activate
  • Install the package with its dependencies as well as development dependencies:

    pip install -e .
    pip install -e '.[dev]'

Unit testing

Unit tests are written with pytest but use some Django test classes for compatibility with Django test suites. Running the tests requires a minimal settings file for Django-required configurations.

  • Copy sample test settings and add a secret key:

    cp ci/
    python -c "import uuid; print('\nSECRET_KEY = \'%s\'' % uuid.uuid4())" >>
  • To run the test, either use the configured test command:

    python test
  • Or install test requirements in and use pytest directly:

    pip install -e '.[test]'


parasolr is distributed under the Apache 2.0 License.

©2019 Trustees of Princeton University. Permission granted via Princeton Docket #20-3619 for distribution online under a standard Open Source license. Ownership rights transferred to Rebecca Koeser provided software is distributed online via open source.

Indices and tables