Skip to content

Any plans to give an easy way to make DSL compatible with elasticsearch_async #556

Closed
@pfreixes

Description

@pfreixes

Hi,

I've seen that you have been working on a project [1] to proxy the official client in aims to achieve a pure asynchronous behavior fully compatible with asyncio. I was wondering if there is any plan to do the same for the DSL project.

Even though is possible to use an asynchronous connection, as the following snippet shows, the principal interface implementation does not allow the developer to use the await statement to get the response. The intermediate object Response is not designed to do so.

client = AsyncElasticsearch(hosts=['localhost'])
async def test():
    s = Search(using=client, index="my-index") \
        .filter("term", category="search") \
        .query("match", title="python")   \
        .query(~Q("match", description="beta"))

    response = await s.execute()

Is there an plan to implement all of this stuff necessary to make the library compatible with asynchronous environments ?

[1] https://github.com/elastic/elasticsearch-py-async

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions