Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valid primary key is refused #4696

Closed
irevoire opened this issue Jun 12, 2024 · 2 comments · Fixed by #4725
Closed

Valid primary key is refused #4696

irevoire opened this issue Jun 12, 2024 · 2 comments · Fixed by #4725
Labels
bug Something isn't working as expected error handler Issues related to the returned errors in Meilisearch
Milestone

Comments

@irevoire
Copy link
Member

Describe the bug
When sending a document with a valid primary key I get a message saying my primary key is invalid.

To Reproduce
Steps to reproduce the behavior:

  1. echo '{ "id": 14630868576586246730, "name": "tamo" }' | mieli d a
  2. Document identifier 14630868576586246730 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 (_).

Expected behavior
It works or returns a better error message

@irevoire irevoire added bug Something isn't working as expected error handler Issues related to the returned errors in Meilisearch labels Jun 12, 2024
@irevoire irevoire changed the title Bad error message Valid primary key is refused Jun 12, 2024
@dureuill
Copy link
Contributor

Hello thanks for reporting,

We should probably amend the error message to include the range of supported integers, which is the i64 range according to the code.

Not sure about the priority of this bug.

@irevoire
Copy link
Member Author

Since there is a workaround and it's old, I would say it's the least priority possible.

We should probably amend the error message to include the range of supported integers, which is the i64 range according to the code.

Can't we also convert the PK to a string if it doesn't fit in an i64 to hide our internal optimization from the end user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected error handler Issues related to the returned errors in Meilisearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants