Registry / database / django-opensearch-dsl

django-opensearch-dsl

JSON →
library0.8.0pypypiunverified

Wrapper around opensearch-py for Django models, providing a high-level interface for indexing and searching Django models in OpenSearch. Current version is 0.8.0. Release cadence is irregular, with 10 releases since 2021.

pip install django-opensearch-dsl
INSTALL
IMPORT
SIG · DJANGO-OPENSEARCH-
D
django-opensearch-dsl
databasepythonv0.8.0
Install
4.6s avg
Import
Disk
44MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 51MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.6s · import 0.000s · 49MB
44MB installed
● package 44MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Document
from django_opensearch_dsl import Document
from django_opensearch_dsl import Document

Define a Document class for a Django model, save it to create the index, and perform a search.

import os from django_opensearch_dsl import Document from django_opensearch_dsl import fields from myapp.models import MyModel class MyModelDocument(Document): title = fields.TextField(attr='title') class Index: name = 'mymodel' # Register and create the index MyModelDocument().save() # Search documents = MyModelDocument.search().query('match', title='test') for doc in documents: print(doc.title)
Debug
Known issues
breakingIn v0.8.0, Document.get_queryset() and Document.get_indexing_queryset() now take an optional 'alias' argument for database selection. Code that overrides these methods without the alias parameter will break.
fix
Update custom get_queryset/get_indexing_queryset methods to accept the optional alias parameter: def get_queryset(self, alias=None): ...
affects: >=0.8.0
breakingIn v0.5.0, keep_order argument of Search.to_queryset now defaults to True. This may change ordering behavior in existing code.
fix
If you rely on default ordering, explicitly pass keep_order=False to restore previous behavior.
affects: >=0.5.0
deprecatedThe opensearch-dsl-py package is deprecated. Import from django-opensearch-dsl instead.
fix
Change imports from opensearch_dsl to django_opensearch_dsl.
affects: all
gotchaSignal processors (RealTimeSignalProcessor, CelerySignalProcessor) must be set via OPENSEARCH_DSL_SIGNAL_PROCESSOR setting, not by importing directly.
fix
In settings.py: OPENSEARCH_DSL_SIGNAL_PROCESSOR = 'django_opensearch_dsl.signals.CelerySignalProcessor'
affects: all
Upgrade
Version history
0.8.0latest on PyPI · released Nov 24, 2025
Audit
Dependencies
opensearch-pyrequiredRequired for OpenSearch connection and document definition.
DjangorequiredRequired for Django model integration.
celeryoptionalOptional for CelerySignalProcessor.
Agent activity
21 hits · last 30 days
node
20
Resources
django-opensearch-dsl — pip install django-opensearch-dsl · libregistry