Skip to content

[6.x] Add --connection and --queue options to search:update - #15357

Open
edalzell wants to merge 4 commits into
statamic:6.xfrom
edalzell:feature/sync-search-index-update
Open

[6.x] Add --connection and --queue options to search:update#15357
edalzell wants to merge 4 commits into
statamic:6.xfrom
edalzell:feature/sync-search-index-update

Conversation

@edalzell

@edalzell edalzell commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

We use the local search driver with zero-downtime deploys, and we run statamic:search:update on each deployment. If indexing stays on the default queue, the new release can go live before the search index is ready, so search is broken until a worker catches up.

--connection and --queue override the queue connection and queue name for that run. --connection=sync indexes inline, so when the deploy finishes, search is already ready. You can also send jobs to another connection and/or named queue without changing config.

Queueing on the configured connection and queue is still the default. Docs for the new flags belong in the statamic.dev repo.

Test plan

  • php artisan statamic:search:update --connection=sync rebuilds the index before the command exits
  • php artisan statamic:search:update --queue=indexing puts jobs on that queue name
  • Both flags can be used together
  • With neither flag, indexing jobs still use the configured search connection and queue

@ryanmitchell

Copy link
Copy Markdown
Contributor

Might be nicer to make it a --queue=xxx option so you can override the default queue instead? Then you could just use the sync queue.

@edalzell

edalzell commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Might be nicer to make it a --queue=xxx option so you can override the default queue instead? Then you could just use the sync queue.

Great idea!

@edalzell
edalzell marked this pull request as draft September 3, 2026 17:03
@edalzell edalzell changed the title [6.x] Add --sync option to search:update [6.x] Add --queue option to search:update Sep 3, 2026
@edalzell edalzell changed the title [6.x] Add --queue option to search:update [6.x] Add --connection option to search:update Sep 3, 2026
@edalzell edalzell changed the title [6.x] Add --connection option to search:update [6.x] Add --connection and --queue options to search:update Sep 3, 2026
Queueing stays the default; --sync runs indexing inline so deploy scripts wait until the index is ready.
Lets you pick the indexing connection per run, including --queue=sync so deploys wait until the index is ready.
sync is a queue connection, not a queue name.
--connection and --queue independently override InsertMultipleJob routing for a single search:update run.
@edalzell
edalzell force-pushed the feature/sync-search-index-update branch from ad8ecb0 to 90f69e5 Compare September 3, 2026 22:11
@edalzell
edalzell marked this pull request as ready for review September 3, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants