与Asyncio集成的ElasticSearch。
aioes的Python项目详细描述
aioes是一个与asyncio兼容的库,用于处理Elasticsearch
文档
阅读aioes有关阅读文档的文档:http://aioes.readthedocs.io/
示例
import asyncio from aioes import Elasticsearch @asyncio.coroutine def go(): es = Elasticsearch(['localhost:9200']) ret = yield from es.create(index="my-index", doc_type="test-type", id=42, body={"str": "data", "int": 1}) assert (ret == {'_id': '42', '_index': 'my-index', '_type': 'test-type', '_version': 1, 'ok': True}) answer = yield from es.get(index="my-index", doc_type="test-type", id=42) assert answer['_source'] == {'str': 'data', 'int': 1} loop = asyncio.get_event_loop() loop.run_until_complete(go())
测试
确保在端口9200上运行ElasticSearch实例 在执行测试之前。
为了使所有测试都能工作,您需要在 config/elasticsearch.yml配置文件:
启用Groovy脚本:
script.groovy.sandbox.enabled: true
设置存储库路径:
path.repo: ["/tmp"]
测试套件使用py.test
,只需运行:
$ py.test
许可证
aioes是根据bsd许可证提供的。
更改
0.7.2(2017-04-19)
- 允许在Transport:138,137中自定义Connector。
- 修正了文档中的几个错误。
0.7.0(2017-03-29)
- 修复ElasticSearch 5.x兼容性问题:48、72、112、73、123。
- 将stored_fields添加到mget、search和explain方法(123)。
- 在health(123)中添加wait_for_no_relocating_shards参数。
- 在analyze(123)中添加filter,token_filter,char_filter参数。
- 添加force_merge方法(重命名为optimize)(123)。
- 在hot_threads_123中添加ignore_idle_threads param。
- 更新项目依赖项。
- 将测试转换为pytest。
0.6.1(2016-09-08)
- 接受字节作为有效载荷42
- 将
Elasticsearch.close()
转换为协同程序。
0.6.0(2016-09-08)
- 添加对verify_ssl_43的支持
0.5.0(2016-07-16)
- 允许在连接中使用方案、用户名和密码40
0.4.0(2016-02-10)
- 修复传输地址regex 38中的es2+兼容性
0.3.0(2016-01-27)
- 在内部使用aiohttp.clientsession 36
0.2.0(2015-10-08)
- 与ElasticSearch 1.7兼容
- 支持Python3.5
- 放弃Python3.3支持
- 根据apache 2重新授权
0.1.0(2014-10-04)
- 初始版本