--- id: django-elasticsearch-dsl-drf version: "0.22.5" license: GPL-2.0-only OR LGPL-2.1-or-later license_treatment: copyleft maintenance: dormant --- # django-elasticsearch-dsl-drf — Integrate Elasticsearch DSL with Django REST framework. License: copyleft · Maintenance: dormant · Downloads: 139.0K/mo ## What it is and what it does django-elasticsearch-dsl-drf bridges Elasticsearch DSL and Django REST framework, letting you expose Elasticsearch documents as REST API endpoints without writing boilerplate views or serializers. It provides pre-built filter backends for search, ordering, filtering, geo-spatial queries, faceting, and highlighting, plus pagination and aggregation support. You define your Elasticsearch documents using django-elasticsearch-dsl, then use this package's viewsets and serializers to turn them into queryable REST endpoints. The package handles the integration layer between two mature ecosystems: it takes your Elasticsearch document definitions and automatically generates REST-compatible serializers, then provides filter backends that translate query parameters into Elasticsearch DSL queries. This is useful when you want full-text search, complex filtering, or faceted navigation in a Django REST API without manually translating HTTP requests into Elasticsearch queries. Use it for: - Build a full-text search API endpoint that accepts query strings and returns ranked results with highlighting. - Create a product catalog API with faceted filtering by category, price range, and geo-spatial distance. - Expose Elasticsearch aggregations as REST endpoints for analytics dashboards or reporting. - Implement auto-complete or suggestion endpoints using Elasticsearch suggesters. - Add complex filtering (range, prefix, wildcard, exists) to a Django REST API without custom query logic. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Django REST framework views, serializers, and filter backends to expose Elasticsearch documents as REST APIs with search, filtering, ordering, pagination, and aggregation support. Yes, with conditions. The package is stable and well-documented for integrating Elasticsearch with Django REST framework, with no known vulnerabilities. However, maintenance is dormant (last release 2022-07-03), so it is best suited for projects on Django 2.2, 3.1, or 3.2 and Elasticsearch 6.x or 7.x that do not require active support. If you need compatibility with newer versions, verify compatibility first or consider alternatives. ## Install pip install django-elasticsearch-dsl-drf uv add django-elasticsearch-dsl-drf poetry add django-elasticsearch-dsl-drf ## Installing django-elasticsearch-dsl-drf Before you install: Low friction install with six runtime dependencies. Maintenance is dormant—last release was 2022-07-03, though the repository remains active with a recent commit on 2024-08-10. Suitable for stable use cases but expect no active development. License in practice: Dual-licensed under GPL-2.0-only or LGPL-2.1-or-later (copyleft). Use requires compliance with one of these licenses; derivative works or distribution must include source code and license terms. Quickstart: pip install django-elasticsearch-dsl-drf # In Django settings.py, add to INSTALLED_APPS: # 'rest_framework', 'django_elasticsearch_dsl', 'django_elasticsearch_dsl_drf' from django_elasticsearch_dsl_drf.viewsets import DocumentViewSet from django_elasticsearch_dsl_drf.serializers import DocumentSerializer class MyDocumentViewSet(DocumentViewSet): serializer_class = DocumentSerializer Requires Elasticsearch 6.x or 7.x running and accessible; Django 2.2, 3.1, or 3.2; Python 3.6, 3.7, 3.8, or 3.9. Verify before relying: - Whether the package works with Elasticsearch 8.x or later versions beyond 7.x. - Current compatibility with Python 3.10+ and Django 4.0+. - Whether dormant status means security patches are still applied or if vulnerabilities would go unaddressed. ## Package facts - License: GPL-2.0-only OR LGPL-2.1-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 139.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags elasticsearch rest api django, django rest framework elasticsearch, elasticsearch dsl django views, elasticsearch search filtering django, elasticsearch pagination django rest, elasticsearch aggregations django api, elasticsearch faceted search django, elasticsearch-integration, rest-api-framework, search-backend [View on SkillFed](https://skillfed.io/packages/django-elasticsearch-dsl-drf) · [View on PyPI](https://pypi.org/project/django-elasticsearch-dsl-drf/)