用于ElasticSearch的异步驱动程序

asynces的Python项目详细描述


#异步
[![构建状态](https://travis-ci.org/fabregas/asynces.svg?branch=master)(https://travis ci.org/fabregas/asynces)
[![codecov](https://codecov.io/gh/fabregas/asynces/branch/master/graph/badge.svg)](https://codecov.io/gh/fabregas/asynces)



AsyncElasticSearch类继承自ElasticSearch类(请参阅[ElasticSearch](https://elasticSearch py.readthedocs.io/en/master/index.html))。


ElasticSearch类实例中的所有方法(请参阅[API doc](http://elasticSearch py.readthedocs.io/en/master/api.html))
在AsyncElasticSearch类中可用实例。

每个api方法返回必须等待的[coroutine](https://docs.python.org/3/library/asyncio task.html coroutines)。


异步用法示例:
``python
从异步导入asyncio
loop=loop)
doc={'hello':'world'}
等待es.index(index='my-index',doc\u type='test',body=doc,refresh=false)
等待。index.refresh(index=“my index”)
ret=await es.search(index=“my-index”)
打印(ret)
es.close()

loop=asyncio.get_event_loop()
循环。运行_直到完成(测试(循环))
loop.close()
````

您应该安装最新版本的[elasticsearch](https://elasticsearch py.readthedocs.io/en/master/index.html compatibility)
与您的elasticsearch服务器版本兼容。

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

推荐PyPI第三方库


热门话题
ArrayList Java中的搜索字符串   另一个web应用程序的java访问会话   另一个应用程序中的活动和服务之间的java通信   java根据Json字符串类型将Json字符串转换为对象   eclipse如何解决java中的错误异常。lang.NoSuchMethodError:'java。字符串javax。摆动JOptionPane。showInputDialog(java.lang.String)'   线程“main”java中的安卓异常。lang.NoClassDefFoundError:org/codehaus/jackson/JsonParseException   java如何在安卓 emulator上显示Mat图像?使用NDK   Java在本地读取测试源文件,但在服务器上读取失败   java dowhile循环用于计算输入数字中的数字。故障排除代码   JAva初学者在编写获取成本的方法时遇到困难   java是shell游戏。我如何让物体移动,特别是在特定的曲线上,但顺序是随机的?   java如何区分两个同名的JButton   java为什么我在Spring Boot中需要一个接口?   java将文件路径插入数据库将删除\   使用InterfaceType初始化java对象   java如何部署一个分为Angular、Spring Boot和MySQL的项目?   java如何使用Symja解决不等式?