用于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服务器版本兼容。
[![构建状态](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服务器版本兼容。