Skip to content

Commit

Permalink
Fix: scroll offset
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Mar 15, 2021
1 parent d30595f commit 650b6c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/elastic/core/scroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ func (ctx *ScrollContext) Get(output interface{}) error {

length := int64(len(hits))
offset := ctx.Offset - count
if offset > length && length < ctx.ChunkSize {
break
}
if offset > 0 {
hits = hits[offset:]
}
Expand Down

0 comments on commit 650b6c7

Please sign in to comment.