Skip to content

Errors of primary key #233

@curquiza

Description

@curquiza

I've just realized that we are not really accurate in the documentation (and in the FAQ) about the primary key error.

We talk about the document id is missing or Missing primary key error.
All of these to mean vaguely "MeiliSearch is not able to infer the infer the primary key" or "your primary key is not well-formatted".

I have no idea to make it clearer right now, but here are the different error states of MeilISearch about the primary key (don't hesitate to complete if I forgot something):

  • Could not infer a primary key appears when you try to push your documents for the first time and MeiliSearch is not able to infer one = no id visible in one of the attributes. This error appears synchronously, I mean, there is no updateId returned during the addition of document because of this error.
  • document id is missing appears asynchronously (you can check it in the update status). It means that a primary key has previously been defined (or well inferred) but you forgot to put this attribute in one of your documents.
  • serializer error; a document primary key can be of type integer or string only composed of alphanumeric characters, hyphens (-) and underscores (_) appears asynchronously (you can check it in the update status). It means that a primary key has previously been defined (or well inferred) but not well-formatted.

=> so there is no "Missing primary key error". And "document id is missing" does not mean a bad inference or a not well-formatting.

I don't say we have to explain all of this in the documentation, but maybe, we can try to make it clearer. At least when we mention error messages.
But as I said, I don't know how to make it better for the moment. I wanted to give all the clues to everyone to think about 🙂

Steps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions