elasticsearch8-dsl
Python client for Elasticsearch
What it is and what it does
elasticsearch8-dsl is a Python wrapper around the official elasticsearch8 client that replaces verbose JSON dict-based query construction with a chainable, Pythonic API. Instead of manually nesting dictionaries to build bool queries, filters, and aggregations, you write method chains that the library translates to equivalent Elasticsearch JSON DSL. It also provides optional document mapping and persistence—you can define Python classes with typed fields that mirror Elasticsearch mappings, then save and retrieve documents as Python objects.
The library stays structurally close to Elasticsearch's native DSL terminology, so queries remain recognizable to anyone familiar with the JSON syntax. It includes a Search class for query building, aggregation support, and a Document base class for object-relational mapping. You can also convert between Search objects and raw dicts, allowing gradual migration from pure elasticsearch8 code.
Use it for:
- Build complex Elasticsearch queries programmatically without manually constructing nested JSON dicts.
- Define document schemas with typed fields and save/retrieve them as Python objects instead of raw dicts.
- Add filters, aggregations, and query clauses dynamically to a search object before execution.
- Migrate incrementally from elasticsearch8 by wrapping existing query dicts and modifying them via the DSL.
- Implement custom document methods and lifecycle hooks for domain logic.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A high-level Python query builder for Elasticsearch that translates idiomatic Python expressions into Elasticsearch JSON DSL queries, plus optional document mapping and persistence.
No. The repository is archived and abandoned with no releases since 2024-01-19 and last commit on 2025-04-18. While the code is permissively licensed and currently has no known vulnerabilities, the lack of active development means security patches, compatibility fixes, and bug fixes will not be forthcoming. Use only if maintaining a legacy application already on this version.
Install
elasticsearch8-dsl on PyPI
pip
pip install elasticsearch8-dsluv
uv add elasticsearch8-dslpoetry
poetry add elasticsearch8-dslInstalling elasticsearch8-dsl
Before you install
Low install friction with only two runtime dependencies (python-dateutil and elasticsearch8). However, the repository is archived and marked abandoned, with the last commit on 2025-04-18 and no releases since 2024-01-19—maintenance has effectively stopped.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install elasticsearch8-dsl
from elasticsearch8_dsl import Search
from elasticsearch import Elasticsearch
client = Elasticsearch("https://localhost:9200")
s = Search(using=client, index="my-index").filter("term", category="search").query("match", title="python")
response = s.execute()
Requires a running Elasticsearch 8.x instance; the library version must match the major version of your Elasticsearch server.
Verify before relying
- Whether the abandoned status and lack of recent releases pose a risk for future Elasticsearch server compatibility.
- Whether security patches or bug fixes will be backported if vulnerabilities are discovered in dependencies.
- Current production usage and whether alternatives are actively maintained.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — python-dateutil, elasticsearch8 |
| Maintenance | abandoned — 938 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 118,614/month — #12,111 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: elasticsearch8_dsl-8.12.0-py3-none-any.whl
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
elasticsearch-dslProvides a high-level Python API for building…
permissive · top 5,000 on PyPI
luqumParses Lucene Query DSL syntax into an abstract…
unclear · top 5,000 on PyPI
django-elasticsearch-dslIndexes Django model instances into…
permissive · top 15,000 on PyPI
elasticsearch5Low-level Python client for Elasticsearch 5.x…
permissive · top 15,000 on PyPI
elasticsearchOfficial Python client library for connecting…
permissive · top 1,000 on PyPI
elasticsearch6Low-level Python client for Elasticsearch that…
permissive · top 15,000 on PyPI
opensearch-dslA Python client library for building and…
permissive · top 15,000 on PyPI
elasticsearch9Official Python client for Elasticsearch that…
permissive · top 15,000 on PyPI
django-elasticsearch-dsl-drfProvides Django REST framework views,…
copyleft · top 15,000 on PyPI
es-clientBuilds and validates Elasticsearch client…
permissive · top 15,000 on PyPI