Studio content-search first writes omit the primary key when the Meilisearch index is missing
Checked 2026-09-30: master source at ca039029e4918f02903b1c7d62adf8b3ad74f75b and release/verawood source at 18ce9a9c2b20c745b0ee94f615c13855acd9624b. Both carry this code path. This is a source diagnostic; no upstream full integration suite or production mutation ran.
Course indexing and incremental rebuild batches submit add_documents without an explicit primary key. When the Studio index already exists with the expected schema, that can work. On a fresh or replaced Meilisearch index, the first document batch can auto-create the index and trigger ambiguous primary-key inference because Studio documents contain multiple id-like fields. The write then fails with index_primary_key_multiple_candidates_found.
Reproduction in a disposable Meilisearch only:
- Start with the Studio content index absent; retain the LMS/CMS database so post_migrate reconciliation is not automatically rerun.
- Run the native course indexing/incremental population path with ordinary Studio documents.
- Observe the ambiguous primary-key task failure.
- Positive control: establish the native index with primaryKey=id before the same write, or provide that primary key explicitly.
Expected: first-write paths either establish the existing native index/schema contract or specify its primary key; they should not depend on a separate migration hook having run on that particular Meilisearch volume. Do not delete populated indexes or silently relabel a different schema.
Historical Verawood indexing observed this failure; current source still omits the write parameter. No fresh engine integration was run for this filing. #36868/#38384 cover schema configuration/upgrade sequencing, while #37578 fixes the same inference error in CourseTeamIndexer, a different index and caller. Current searches: Meilisearch primary key; content search primary key.
Source: openedx/openedx-platform