fix the limit

There was no check on the limit and thus, if a user especified a very large number this line could causes a panic
This commit is contained in:
Tamo 2021-06-22 14:52:13 +02:00
parent 5b6adc6d96
commit 3d90b03d7b
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69

View File

@ -162,7 +162,7 @@ impl<'a> Search<'a> {
let mut offset = self.offset;
let mut initial_candidates = RoaringBitmap::new();
let mut excluded_candidates = RoaringBitmap::new();
let mut documents_ids = Vec::with_capacity(self.limit);
let mut documents_ids = Vec::new();
while let Some(FinalResult { candidates, bucket_candidates, .. }) =
criteria.next(&excluded_candidates)?