Skip to content

Add support for any iterable with "Terms" query #1641

Closed
@roxanebellot

Description

@roxanebellot

"Terms" query currently only support list parameters : using Terms(field1=(1, 2, 3), field2={"foo", "bar"}) would result in a SerializationError.

Is there a reason not to support any iterable ? It would be more pythonic and also ease integration with other framwework (thinking of Django's QuerySet)

An easy way to implement this is redefining Terms._setattr :

class Terms():
    ...
    def _setattr(self, name, value):
        super()._setattr(name, list(value))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions