与Asyncio集成的ElasticSearch。

aioes的Python项目详细描述


aioes是一个与asyncio兼容的库,用于处理Elasticsearch

https://travis-ci.org/aio-libs/aioes.svg?branch=masterhttps://codecov.io/gh/aio-libs/aioes/branch/master/graph/badge.svg

文档

阅读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添加到mgetsearchexplain方法(123)。
  • health(123)中添加wait_for_no_relocating_shards参数。
  • analyze(123)中添加filtertoken_filterchar_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)

  • 初始版本

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓应用程序中google+集成中的java注销问题   java使用Roboeletric和Gradle   使用Netbeans 7.0连接到SQL Server的java正在挂起   jmx java。lang:type=Runtime不是接口java的实例。朗,管理层。RuntimeMXBean   java我的程序没有运行,虽然它没有给我错误   java在启动时启动服务,并从BR的onReceive方法启动活动   使用java在Selenium中更新文件,然后上载文件   java定制JPA CriteriaQuery的onclause   JavaFX:不使用FXML返回主页面   java将乘法运算的一个操作数强制转换为长?   java getActionView已被弃用?   java如何在hadoop中获得像素rgb值?   java解析巨大的xml文件以从子标记中获取不同的值需要最佳方法建议   java为带有requestMapping注释的控制器和方法禁用spring度量名称规则