skillfed

pysolr

Lightweight Python client for Apache Solr

pysolr v3.11.0 352.8K downloads/30d#7,307 on PyPI701
Permissive license BSD Active released

What it is and what it does

pysolr is a Python wrapper around Apache Solr's HTTP API that handles the low-level details of communicating with a Solr search server. It lets you index documents, search them with Lucene-style queries, and manage the index through a simple Python interface. The package abstracts away HTTP request construction and response parsing, so you work with Python objects and method calls instead of raw JSON.

Typical workflows involve creating a Solr client instance pointing to your server, adding or updating documents in batches, and then running searches with optional parameters like highlighting or faceting. It supports both standalone Solr instances and SolrCloud deployments with Zookeeper coordination. The package requires an external Solr server to be running—it is not a search engine itself, only a client library.

Use it for:

  • Index and search documents in a web application backed by Apache Solr without writing HTTP request code.
  • Perform full-text search queries with faceting, highlighting, and spelling correction on large document collections.
  • Manage multi-core or SolrCloud deployments by routing queries and updates to the correct collection or core.
  • Implement batch document ingestion pipelines that add, update, or delete documents in Solr with custom commit policies.
  • Build autocomplete or typeahead features using custom Solr request handlers through pysolr's handler configuration.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pysolr is a lightweight Python client for Apache Solr that enables querying, indexing, and deleting documents in a Solr search server, with support for advanced features like highlighting, faceting, and SolrCloud.

Yes, if you are already running Apache Solr and need a Python client. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and is stable (Production/Stable status). The main barrier is the strict Python 3.10+ requirement and the need for an external Solr server; if those are met, it is a straightforward, reliable choice for Solr integration.

Install

pysolr on PyPI

pip

pip install pysolr

uv

uv add pysolr

poetry

poetry add pysolr

Installing pysolr

Before you install

High install friction: requires Python 3.10+ and Requests 2.32.5+. The package is actively maintained (last commit 2026-08-07, 269 days since latest release) with stable production status, but the strict version requirements and external Solr server dependency mean setup is non-trivial.

License in practice

BSD license (permissive) means you can use, modify, and distribute pysolr freely in commercial and private projects with minimal restrictions, provided you include the license notice.

Quickstart

pip install pysolr

import pysolr

solr = pysolr.Solr('http://localhost:8983/solr/', always_commit=True)
solr.ping()
results = solr.search('bananas')
for result in results:
    print(result['title'])

Requires a running Apache Solr server accessible at the URL you provide; Python 3.10+ and Requests 2.32.5+ are also required.

Verify before relying

  • Whether optional dependencies (simplejson, kazoo) are automatically installed or require explicit installation for their respective features.
  • Performance characteristics and scalability limits for large document sets or high-query-volume scenarios.
  • Compatibility with specific Solr server versions beyond the general 'Apache Solr' reference.

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.10)
Install friction high — source build required
Runtime dependencies 2 — requests, setuptools
Maintenance actively maintained — 269 days since the last release
Last repo commit
First released
Downloads 352,813/month — #7,307 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pysolr-3.11.0.tar.gz

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Internet :: WWW/HTTP :: Indexing/Search

Tags

solr python clientapache solr search librarysolr indexing and queryingsolr document managementsolrcloud pythonfull-text search pythonsolr api wrapper
search-indexingsolr-clientinformation-retrieval

More Indexing/Search packages