Skip to content

object ObjectApiResponse can't be used in 'await' expression #1976

Open
@772201902

Description

@772201902

elasticsearch-dsl~=8.17.1

I want to use ES's asynchronous query. I have verified that it is available during synchronization, but there will be an error when using the corresponding asynchronous library

The code is as follows:
EsClient = elasticsearch.Elasticsearch(config.esArgs.uri, basic_auth=(config.esArgs.user, config.esArgs.passwd))
query_obj = elasticsearch_dsl.AsyncSearch(using=EsClient, index=index)
query_obj = query_obj.query(body)
response =await query_obj.execute()
logging.debug(f"response: {response}")

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