Skip to content

Slicing twice doesn't work #799

Closed
@konstin

Description

@konstin

Iterators are expected to allow slicing twice, i.e.

>>> list(range(0,100)[10:15])
[10, 11, 12, 13, 14]
>>> list(range(0,100)[10:][:5])
[10, 11, 12, 13, 14]

This means essentially that [a:a+b] equals [a:][:b]

With a Search object slicing twice doesn't work:

>>> Search()[10:15].to_dict()
{'from': 10, 'query': {'match_all': {}}, 'size': 5}
>>> Search()[10:][:5].to_dict()
{'from': 0, 'query': {'match_all': {}}, 'size': 5}

(Sorry for submitting an incomplete issue first, I accidentally hit the wrong key)

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