Skip to content

Calling .aggregations before .response causes a search to be executed twice. #975

Open
@aburkard

Description

@aburkard

For example:

resp = MyModel.__elasticsearch__.search(query)
resp.aggregations
# Search is conducted
resp.response
# The same search is run again

I see others have had a similar issue before. It appears the issue is that .aggregations calls .raw_response which executes the query, and then .response re-executes the query. Is there any reason not to implement this patch? I see there was a concern about thread-safety.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions