Skip to content

Latest commit

 

History

History
89 lines (68 loc) · 3.95 KB

README.rst

File metadata and controls

89 lines (68 loc) · 3.95 KB

Django AnySearch DSL

https://codecov.io/gh/django-anysearch/django-anysearch-dsl/coverage.svg?branch=master https://readthedocs.org/projects/django-anysearch-dsl/badge/?version=latest&style=flat

Django AnySearch DSL is a package that allows indexing of Django models in Elasticsearch/OpenSearch. It is built as a thin wrapper around elasticsearch-dsl-py (and OpenSearch alternative).

You can view the full documentation at https://django-anysearch-dsl.readthedocs.io

Manifest

This project is a fork of django-elasticsearch-dsl with a single ultimate purpose of supporting both Elasticsearch and OpenSearch. Compatibility is achieved through anysearch which does necessary import replacements depending on which one (Elasticsearch or OpenSearch) is chosen (similarly to what six package does to support both 2.x and 3.x branches of Python).

  • Both elasticsearch and elasticsearch-dsl are optional dependencies (as well as opensearch-py and opensearch-dsl) and are installed when instructed (like pip install django-anysearch-dsl[elasticsearch] or pip install django-anysearch-dsl[opensearch]).
  • anysearch is a required dependency.

The plan is to stay in sync with the django-elasticsearch-dsl, so if you're missing a feature or have a bugfix, please propose it in the upstream.

  • Submit PRs here only if they are solely related to this package and not the django-elasticsearch-dsl.
  • Do not propose code style changes or changes that contain reformatting of the code (like black or isort fixes). Such things shall be proposed in the django-elasticsearch-dsl. Code changes to this package are kept minimal, so that it's easier to stay in sync.

Versioning is kept in sync up to the build (in terms of Semantic versioning major.minor[.build[.revision]), so version 7.2.2.x of this library would represent the version 7.2.2 of the upstream. All changes are mentioned in the changelog.

This library is a drop-in replacement, it does have the same namespace as django-elasticsearch-dsl, thus you can't have both installed.

Due to complexities, no support for older versions of Elasticsearch (< 7.x) is provided (and will never be).

Features

  • Based on elasticsearch-dsl-py so you can make queries with the Search class.

  • Django signal receivers on save and delete for keeping Elasticsearch in sync.

  • Management commands for creating, deleting, rebuilding and populating indices.

  • Elasticsearch auto mapping from django models fields.

  • Complex field type support (ObjectField, NestedField).

  • Index fast using parallel indexing.

  • Requirements

    • Django >= 2.2
    • Python 3.6, 3.7, 3.8, 3.9, 3.10 or 3.10.

Elasticsearch Compatibility: The library is compatible with Elasticsearch 7.x, OpenSearch 1.x and OpenSearch 2.x.

# Elasticsearch 7.x
elasticsearch-dsl>=7.0.0,<8.0.0

# OpenSearch 1.x
opensearch-dsl>=1.0,<2.0

# OpenSearch 2.x
opensearch-dsl>=2.0,<3.0