pysolr
Lightweight Python client for Apache Solr
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 pysolruv
uv add pysolrpoetry
poetry add pysolrInstalling 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
Tags
More Indexing/Search packages
Provides stemming algorithms for 34 languages,…
permissive · top 1,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
firecrawl-pyClient library for the Firecrawl API that…
permissive · top 5,000 on PyPI
ddgsAggregates web search results from multiple…
permissive · top 5,000 on PyPI
duckduckgo-searchRetrieves search results from DuckDuckGo for…
permissive · top 5,000 on PyPI
algoliasearchA Python HTTP client for interacting with…
permissive · top 5,000 on PyPI
sqlalchemy-solrProvides a SQLAlchemy dialect that allows you…
permissive · top 15,000 on PyPI
elasticsearchOfficial Python client library for connecting…
permissive · top 1,000 on PyPI
elasticsearch9Official Python client for Elasticsearch that…
permissive · top 15,000 on PyPI
metal-sdkPython client library for indexing and querying…
permissive · top 15,000 on PyPI
django-haystackHaystack provides a unified search API for…
permissive · top 15,000 on PyPI
WhooshWhoosh is a pure-Python full-text search and…
permissive · top 5,000 on PyPI
modelsearchIndexes Django models into Elasticsearch,…
permissive · top 15,000 on PyPI
kazooKazoo provides a higher-level Python client API…
permissive · top 5,000 on PyPI
pagefindProvides an async Python API to index and…
permissive · top 5,000 on PyPI
Whoosh-ReloadedWhoosh-Reloaded is a pure-Python full-text…
permissive · top 15,000 on PyPI