We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e765c4c commit 9725e54Copy full SHA for 9725e54
elasticsearch_dsl/search_base.py
@@ -362,18 +362,18 @@ def __getitem__(self, n):
362
slice_stop = n + 1
363
364
old_from = s._extra.get("from")
365
- old_to = (old_from or 0) + s._extra["size"] if "size" in s._extra else None
+ old_to = None
366
+ if "size" in s._extra:
367
+ old_to = (old_from or 0) + s._extra["size"]
368
369
+ new_from = old_from
370
if slice_start is not None:
371
new_from = (old_from or 0) + slice_start
- else:
- new_from = old_from
372
+ new_to = old_to
373
if slice_stop is not None:
374
new_to = (old_from or 0) + slice_stop
375
if old_to is not None and old_to < new_to:
376
new_to = old_to
- new_to = old_to
377
378
if new_from is not None:
379
s._extra["from"] = new_from
0 commit comments