Skip to content
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.

Add scan helper #142

Closed
pquentin opened this issue Apr 25, 2017 · 2 comments
Closed

Add scan helper #142

pquentin opened this issue Apr 25, 2017 · 2 comments

Comments

@pquentin
Copy link
Contributor

The search with scan, scroll and clear_scroll primitives are implemented in the client, but a scan helper is still lacking. It would work like http://elasticsearch-py.readthedocs.io/en/master/helpers.html#scan

For Python 3.6+, it could be an asynchronous generator, which would be closest to the official ES client.
For Python 3.5+, it could be an async for:

async for hit in Scan(
        client=client, index=..., doc_type=...,
        query={"query": {"bool": {"filter": ...}}}):
    ...

The only way to support Python 3.4 would be to add a callback, I guess, but that's not a good fit with asyncio's model, so maybe 3.4 can be dropped for this feature.

Thoughts?

@hellysmile
Copy link
Contributor

@pquentin Hey, fill free to copy-paste https://github.com/wikibusiness/aioelasticsearch/blob/master/aioelasticsearch/helpers.py

@pquentin
Copy link
Contributor Author

pquentin commented Feb 1, 2018

Thanks @hellysmile. Closing.

@pquentin pquentin closed this as completed Feb 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants