mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-19 09:35:51 +08:00
Ignore when there are too many vectors
This commit is contained in:
parent
f3e4d70638
commit
63bfe1cee2
@ -50,16 +50,12 @@ pub fn extract_vector_points<R: io::Read + io::Seek>(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i, vector) in vectors.into_iter().enumerate() {
|
for (i, vector) in vectors.into_iter().enumerate().take(u16::MAX as usize) {
|
||||||
match u16::try_from(i) {
|
let index = u16::try_from(i).unwrap();
|
||||||
Ok(i) => {
|
let mut key = docid_bytes.to_vec();
|
||||||
let mut key = docid_bytes.to_vec();
|
key.extend_from_slice(&index.to_be_bytes());
|
||||||
key.extend_from_slice(&i.to_ne_bytes());
|
let bytes = cast_slice(&vector);
|
||||||
let bytes = cast_slice(&vector);
|
writer.insert(key, bytes)?;
|
||||||
writer.insert(key, bytes)?;
|
|
||||||
}
|
|
||||||
Err(_) => continue,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else => the `_vectors` object was `null`, there is nothing to do
|
// else => the `_vectors` object was `null`, there is nothing to do
|
||||||
|
Loading…
Reference in New Issue
Block a user