elasticsearch-dsl和opensearch-dsl的Django模型的包装器
项目描述
Django AnySearch DSL是一个允许在Elasticsearch/OpenSearch中索引Django模型的软件包。它作为elasticsearch-dsl-py(和OpenSearch替代品)的薄包装器构建。
您可以在https://django-anysearch-dsl.readthedocs.io查看完整的文档
清单
此项目是django-elasticsearch-dsl的分支,其单一终极目的是支持Elasticsearch和OpenSearch。通过anysearch实现兼容性,根据选择哪个(Elasticsearch或OpenSearch),执行必要的导入替换(类似于six软件包如何支持Python 2.x和3.x分支)。
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
History
7.1.4 (2020-07-05)
Configure Elasticsearch _id dynamically from document (#272)
Use chain.from_iterable in for performance improvement (#278)
Handle case where SimpleLazyObject being treated as an Iterable (#255)
Camelcase default value in management command (#254)
Various updates and fixup in docs (#250, #276)
Start testing against Python 3.8 (#266)
7.1.1 (2019-12-26)
Adding detailed documentation and published to Read The Docs #222
Resolve name resolution while delete, create index (#228)
Added support for Django 3.0. (#230)
Removing old Elasticsearc compatibility (#219)
Drop StringField in favor of TextField.
7.1.0 (2019-10-29)
Support for Django DecimalField #141
Indexing speedup by using parallel indexing. #213. Now you can pass –parallel or set ELASTICSEARCH_DSL_PARALLEL in your settings to get indexing speed boost while indexing through management command.
Fixing name resolution in management command #206
Small documentation fixes. #196
7.0.0 (2019-08-11)
Support Elasticsearch 7.0 (See PR #176)
Added order by to paginate queryset properly (See PR #153)
Remove standard token filter from README.md and test files
Various documentation fixes
6.4.2 (2019-07-26)
Fix document importing path
Update readme
6.4.1 (2019-06-14)
The DocType import has changed to Document
6.4.0 (2019-06-01)
Support elasticsearch-dsl>6.3.0
类 Meta 已更改为类 Django(参见 PR #136)
添加 register_document 装饰器以注册文档(参见 PR #136)
其他额外的错误修复
0.5.1 (2018-11-07)
限制 elastsearch-dsl 到支持版本
0.5.0 (2018-04-22)
感谢 HansAdema 添加对 Elasticsearch 6 的支持
破坏性变更
Django 字符串字段现在默认指向 ES 文本字段。对于 ES 2.X,不应有任何变化,但如果您使用 ES 5.X,可能需要重建和/或更新一些文档。
0.4.5 (2018-04-22)
修复删除相关模型时的 prepare 问题(参见 PR #99)
修复对 get_instances_from_related 的不必要调用
修复空 ArrayField(CBinyenya)
修复相关对象不存在时的嵌套 OneToOneField(CBinyenya)
更新 elasticsearch-dsl 最小版本
0.4.4 (2017-12-13)
修复与 es 5.0/5.1 的 to_queryset
0.4.3 (2017-12-12)
修复删除相关对象时的同步
添加对 django 2.0 的支持
0.4.2 (2017-11-27)
在序列化之前将懒字符串转换为字符串
更新说明文档(arielpontes)
0.4.1 (2017-10-17)
更新示例应用以使用 get_instances_from_related
拼写/语法修正
0.4.0 (2017-10-07)
在 Search 类中添加一个方法,用于从 es 结果返回 django 查询集
为 DocType.Meta 添加 queryset_pagination 选项,以便在索引填充期间允许对大 django 查询集进行分页
删除对 django 查询集 iterator 方法的调用
修复 DocType 继承。DocType 现在作为类存储在注册表中,而不是作为实例
0.3.0 (2017-10-01)
添加对如果相关模型更新则重新同步 ES 文档的支持(HansAdema)
更好地管理 django FileField 和 ImageField
修复文档中的某些错误(barseghyanartur,diwu1989)
0.2.0 (2017-07-02)
用易于定制的信号处理器替换简单的模型信号(barseghyanartur)
添加选项以禁用自动索引刷新(HansAdema)
通过 Meta 类支持定义 DocType 索引(HansAdema)
添加选项,通过 Django 配置设置默认索引设置(HansAdema)
0.1.0 (2017-05-26)
PyPI 上的第一个版本。
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。
源分布
构建分布
哈希 对 django_anysearch_dsl-7.2.2.1-py2.py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 03c06323a9d7c397bc53dadc4c4eece2993a19fad5e9bad2d74145223396113a |
|
MD5 | 980230eaca1888b78ec43bd05568a22f |
|
BLAKE2b-256 | 74309daa6b51171235d8c2138e1fdad0f8e316acda6b49b1aff80bf24be8f407 |