Skip to content

Commit bf79ae2

Browse files
authored
fix startOffset (#1081)
fixes #1079
1 parent d0a46c0 commit bf79ae2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

quickwit-search/src/collector.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,14 @@ impl Collector for QuickwitCollector {
289289
// We compute the overall [0..start_offset + max_hits) documents ...
290290
let num_hits = self.start_offset + self.max_hits;
291291
let mut merged_leaf_response = merge_leaf_responses(segment_fruits, num_hits);
292-
// ... and drop the first [..start_offets) hits.
292+
// ... and drop the first [..start_offsets) hits.
293293
merged_leaf_response
294294
.partial_hits
295-
.drain(0..self.start_offset)
295+
.drain(
296+
0..self
297+
.start_offset
298+
.min(merged_leaf_response.partial_hits.len()),
299+
)
296300
.count(); //< we just use count as a way to consume the entire iterator.
297301
Ok(merged_leaf_response)
298302
}

0 commit comments

Comments
 (0)