elasticsearch-py wrapper for asyncio
Project description
- info:
elasticsearch-py wrapper for asyncio
Installation
pip install aioelasticsearch
Usage
import asyncio
from aioelasticsearch import Elasticsearch
async def go():
es = Elasticsearch()
print(await es.search())
await es.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(go())
loop.close()
Features
Asynchronous scroll
import asyncio
from aioelasticsearch import Elasticsearch
from aioelasticsearch.helpers import Scan
async def go():
async with Elasticsearch() as es:
async with Scan(
es,
index='index',
doc_type='doc_type',
query={},
) as scan:
print(scan.total)
async for doc in scan:
print(doc['_source'])
loop = asyncio.get_event_loop()
loop.run_until_complete(go())
loop.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioelasticsearch-0.4.0.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for aioelasticsearch-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c73c881d9bda8203234842532b4f47ab5a71f6edef09c588dd8073caff62b8b0 |
|
MD5 | dd429f38e43e7088e1082b3048ae189a |
|
BLAKE2b-256 | 4a6a124c3c60d457c701dbc579ee12cfa39629661bec4dad407849d6132b39fb |