Add --wait option to odm:schema:create and odm:schema:update - #3028
Open
GromNaN wants to merge 1 commit into
Open
Add --wait option to odm:schema:create and odm:schema:update#3028GromNaN wants to merge 1 commit into
--wait option to odm:schema:create and odm:schema:update#3028GromNaN wants to merge 1 commit into
Conversation
--wait option to odm:schema:create and odm:schema:update
Member
Author
|
I'm now thinking that the command should not return 0 when the Edit: this is already the case. In case of timeout, a |
Search indexes are built asynchronously by the server: create and
update return before the index is queryable. Scripts that need the
index to be ready (CI seeding, deployments, integration tests) had
to reimplement the wait around SchemaManager::waitForSearchIndexes().
Expose it as a --wait option on both commands. The value is a
duration string parsable by strtotime() ("30 seconds", "1minute",
"1 hour") or a positive integer of milliseconds. When --wait is
passed without a value, it falls back to the SchemaManager default
of 10 seconds. The wait is skipped automatically when no mapped
class declares a search index.
Refs doctrine#3026
GromNaN
force-pushed
the
feature-3026-schema-create-wait
branch
from
July 9, 2026 13:54
9b8ae0a to
163a867
Compare
paulinevos
reviewed
Jul 13, 2026
|
|
||
| $ php mongodb.php odm:schema:create --search-index --wait=1minute | ||
|
|
||
| The value accepts a duration such as ``30 seconds``, ``1minute`` or |
Contributor
There was a problem hiding this comment.
I think this could be clarified as it seems to be a maximum duration. I'm assuming that the script stops when the index is ready and doesn't wait out the remainder of the duration.
Member
Author
There was a problem hiding this comment.
Yes, that's a wait timeout, can you update the description and merge?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3026.
Search indexes are built asynchronously by the server:
odm:schema:createandodm:schema:updatereturn before the index is queryable. Scripts that need the index to be ready (CI seeding, deployments, integration tests) had to reimplement the wait aroundSchemaManager::waitForSearchIndexes(). This matters more withautoEmbed(#3024), where the initial embedding backfill through Voyage AI can take minutes on non-trivial collections.Both commands now accept a
--waitoption with an optional value:The value is a duration string parsable by
strtotime()(30 seconds,1minute,1 hour) or a positive integer of milliseconds. When--waitis passed without a value, it falls back to theSchemaManagerdefault of 10 seconds. The wait is skipped automatically when no mapped class declares a search index.Documentation has been updated in
docs/en/reference/search-indexes.rstand the vector-search cookbook, including a note that waiting reports index readiness only, not that the background indexer has caught up with documents inserted after index creation.