mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Merge #5144
5144: Exactly 512 bytes docid fails r=Kerollmops a=dureuill # Pull Request ## Related issue Fixes #5050 ## What does this PR do? - Return a user error rather than an internal one for docids of exactly 512 bytes - Fix up error message to indicate that exactly 512 bytes long docids are not supported. - Fix up error message to reflect that index uids are actually limited to 400 bytes in length ## Impact - Impacts docs: - update [this paragraph](https://www.meilisearch.com/docs/learn/resources/known_limitations#length-of-primary-key-values) to say 511 bytes instead of 512 Co-authored-by: Louis Dureuil <louis@meilisearch.com>
This commit is contained in:
commit
eaabc1af2f
7 changed files with 90 additions and 12 deletions
|
@ -280,7 +280,7 @@ fn starts_with(selector: &str, key: &str) -> bool {
|
|||
|
||||
pub fn validate_document_id_str(document_id: &str) -> Option<&str> {
|
||||
if document_id.is_empty()
|
||||
|| document_id.len() > 512
|
||||
|| document_id.len() >= 512
|
||||
|| !document_id.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')
|
||||
{
|
||||
None
|
||||
|
|
|
@ -114,7 +114,7 @@ pub enum UserError {
|
|||
"Document identifier `{}` is invalid. \
|
||||
A document identifier can be of type integer or string, \
|
||||
only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores (_), \
|
||||
and can not be more than 512 bytes.", .document_id.to_string()
|
||||
and can not be more than 511 bytes.", .document_id.to_string()
|
||||
)]
|
||||
InvalidDocumentId { document_id: Value },
|
||||
#[error("Invalid facet distribution, {}", format_invalid_filter_distribution(.invalid_facets_name, .valid_facets_name))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue