You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
Dsl does a lot of sync calls, i.e. DocType.save() or Search.execute(). You need to subclass and change it to await calls from underlying async transport.
The DSL Search has a to_dict() method that you can then pass as the body to the async es client. Seems to work for me.
Something like this:
from elasticsearch_async import AsyncElasticsearch
es = AsyncElasticsearch(hosts=["localhost"])
q = # build your query
s = Search(index=INDEX_NAME).query(q)
r = await es.search(index=INDEX_NAME, body=s.to_dict())
Is it possible to use this with elasticsearch-dsl?
The text was updated successfully, but these errors were encountered: