mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-07 02:20:55 -05:00
Fix distance matrix min samples found (#5036)
This commit is contained in:
@@ -204,6 +204,11 @@ impl Collection {
|
||||
sampled_points.extend(filtered);
|
||||
}
|
||||
|
||||
// if we have less than 2 points, we can't build a matrix
|
||||
if sampled_points.len() < 2 {
|
||||
return Ok(CollectionSearchMatrixResponse::default());
|
||||
}
|
||||
|
||||
sampled_points.truncate(sample_size);
|
||||
// sort by id for a deterministic order
|
||||
sampled_points.sort_unstable_by(|(id1, _), (id2, _)| id1.cmp(id2));
|
||||
|
||||
Reference in New Issue
Block a user