SchemaManager::waitForSearchIndexes() exists but isn't exposed by odm:schema:create/update. Since these commands create search indexes via createSearchIndexes()/updateSearchIndexes(), which only submit the definition, scripts that need the index queryable (CI, deploys, seed scripts) have to reimplement the create logic to add a wait.
This matters more with autoEmbed (#3024): the initial embedding backfill runs through Voyage AI and can take minutes on non-trivial collections, vs. seconds for regular Atlas Search indexes.
Proposal
Add --wait (and optionally --wait-ms, defaulting to waitForSearchIndexes()'s own default) to odm:schema:create and odm:schema:update. When set, call \$sm->waitForSearchIndexes(\$classNames, \$waitMs) after submitting definitions.
Happy to PR — flagging first to confirm the flag shape (single --wait vs. --wait + --wait-ms).
SchemaManager::waitForSearchIndexes()exists but isn't exposed byodm:schema:create/update. Since these commands create search indexes viacreateSearchIndexes()/updateSearchIndexes(), which only submit the definition, scripts that need the index queryable (CI, deploys, seed scripts) have to reimplement the create logic to add a wait.This matters more with
autoEmbed(#3024): the initial embedding backfill runs through Voyage AI and can take minutes on non-trivial collections, vs. seconds for regular Atlas Search indexes.Proposal
Add
--wait(and optionally--wait-ms, defaulting towaitForSearchIndexes()'s own default) toodm:schema:createandodm:schema:update. When set, call\$sm->waitForSearchIndexes(\$classNames, \$waitMs)after submitting definitions.Happy to PR — flagging first to confirm the flag shape (single
--waitvs.--wait+--wait-ms).