Skip to content

odm:schema:create has no option to wait for search/vector indexes to become READY #3026

Description

@GromNaN

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions