Skip to content

Issue: MeilliSearch:The primary key inference failed as the engine found 2 fields ending with id in their names #2079

@jpinn97

Description

@jpinn97

Failed to send message: [meilisearch]: The primary key inference failed as the engine found 3 fields ending with id in their names: 'contact_id' and 'id'. Please specify the primary key manually using the primaryKey query parameter.

  "record": {
    "contact_id": "x,
    "contact_type": "T_GENERAL_MANAGER",
    "created_at": "2025-09-19T01:16:25.341585Z",
    "id": "x",
    "notes": null,
    "site_id": x",
    "updated_at": "2025-09-19T01:16:25.341585Z"
  },
  "metadata": {
    "idempotency_key": "x",
    "commit_lsn": null,
    "commit_idx": null,
    "record_pks": [
      "x"
    ],
    "commit_timestamp": "2025-09-27T15:28:58.555943Z",
    "table_name": "x",
    "table_schema": "x",
    "database_name": "x",
    "transaction_annotations": null,
    "enrichment": null,
    "consumer": {
      "id": "x",
      "name": "main-meilisearch-sink",
      "annotations": {}
    },
    "database": {
      "id": "x",
      "name": "x",
      "hostname": "x",
      "annotations": {},
      "database": "luna"
    }
  },
  "action": "read",
  "changes": null
}

Upon backfilling some tables that have multiple fields ending with 'id' the backfill is reported success, but it also reports the same amount of messages that the meilisearch engine fails to upsert/insert. Meilisearch when the index is created you specify the primary key, or you can optionally pass that along when you do upserts etc.

So this case we had 92 inserts and the backfill reports success, we then get 92 failed messages like above, with the failure message and payload saying read/no change but also a issue with what is a insert related problem of no specified key.?

Note that this does not happen for all tables that have multiple fields ending in 'id'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions