Skip to content

docs(hosting): explain SHOPWARE_ADMIN_ES_REFRESH_INDICES and align its default - #2467

Open
Vin Le (vienthuong) wants to merge 3 commits into
mainfrom
docs/admin-es-refresh-indices
Open

docs(hosting): explain SHOPWARE_ADMIN_ES_REFRESH_INDICES and align its default#2467
Vin Le (vienthuong) wants to merge 3 commits into
mainfrom
docs/admin-es-refresh-indices

Conversation

@vienthuong

Copy link
Copy Markdown
Contributor

Summary

SHOPWARE_ADMIN_ES_REFRESH_INDICES is documented in two places, and neither says what it does.

  • Environment variable reference described it as "Refresh administration indices" — a restatement of the name that reads like Elasticsearch's _refresh API. What it actually controls is AdminSearchRegistry::refreshIndices(): on every write of an indexed entity, indexers whose alias is missing get a fresh index + alias, and their admin_elasticsearch_index_task row is re-inserted. Replaced with a description of the behaviour, its cost, and its caveat, following the format already used by the SHOPWARE_ADMIN_ES_THROW_EXCEPTION row.
  • Admin Elasticsearch setup snippet set it to 1. That is the only line in the block diverging from the shipped default — SHOPWARE_ADMIN_ES_ENABLED=1 is the switch you must flip, and INDEX_PREFIX / INDEXING_BATCH_SIZE / THROW_EXCEPTION all match their defaults. So a copy-paste opted readers into an existsAlias call per indexer (17 in core) on every admin write, plus the possibility of an empty index behind a live alias, without a word of explanation — while bin/console es:admin:index, the thing that makes it unnecessary, is documented three lines below. Set to 0 and added an info block on when 1 is the right call.

Related links

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant.
  • I added or updated redirects in .gitbook.yaml if pages were moved, renamed, or deleted. — n/a, no pages moved
  • I updated .wordlist.txt (and sorted it) if spellcheck flags new legitimate terms. — n/a, "indexer"/"indexers" already appear in checked prose (flags-reference.md, extensibility-events-messages.md)
  • Any required dependent changes in downstream modules have already been merged and published.
  • This pull request is ready for review.

Notes

One open question for a reviewer who knows the history. I could find no recorded reason for =1 in the setup guide — no ->info() on the config node, no comment on refreshIndices(), and the introducing commit (105501782f8, NEXT-21467) shipped no changelog line about the flag. I read =1 as an oversight given the rest of the block, but if it was deliberate — e.g. for managed hosting where nobody runs CLI after installing an extension — then the value should stay 1 and only the info block should land. Happy to drop the value change and keep the prose.

Left as a draft pending that confirmation.

…s default

The environment variable reference only restated the variable name
("Refresh administration indices"), which reads as the Elasticsearch
`_refresh` API rather than what it does: create missing administration
indices and aliases on entity write.

The admin setup snippet also set it to `1`, the only value in that block
that diverges from the shipped default. `SHOPWARE_ADMIN_ES_ENABLED` is
the switch you have to flip; every other line matches the default, so
`=1` here silently opted readers into an alias check per indexer on
every write, with the created index staying empty until a reindex.

Align the snippet with the installer default and describe the trade-off
so enabling it stays a deliberate choice.
@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Aug 21, 2026

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: 2503481
Preview: https://developer-documentation-e2b4pdsn2-shopware-frontends.vercel.app
Workflow run: #5007

@vienthuong Vin Le (vienthuong) self-assigned this Aug 21, 2026
@vienthuong Vin Le (vienthuong) added Guide Guides section of dev docs Product Products section of dev docs labels Aug 21, 2026
@vienthuong
Vin Le (vienthuong) requested review from Micha Hobert (Isengo1989) and a lite review from Copilot August 21, 2026 09:28
@vienthuong
Vin Le (vienthuong) marked this pull request as ready for review August 21, 2026 09:28
@github-actions

Copy link
Copy Markdown
Contributor

📢 Developer Announcement Recommendation

Recommendation: ❌ No Announcement Recommended

No developer announcement signals were detected.

This PR does not appear to introduce developer-facing changes that require a community announcement.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Shopware hosting documentation by clarifying what SHOPWARE_ADMIN_ES_REFRESH_INDICES actually does and by adjusting the admin Elasticsearch/OpenSearch setup snippet to avoid enabling a costly behavior by default when copy-pasted.

Changes:

  • Set SHOPWARE_ADMIN_ES_REFRESH_INDICES=0 in the admin search setup example and added an info callout explaining when =1 is appropriate and what tradeoffs it has.
  • Replaced the environment-variable reference description with a behavior-focused explanation (including operational cost/caveat).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
guides/hosting/infrastructure/elasticsearch/elasticsearch-setup.md Aligns the setup snippet with a safer default and adds an info block explaining the flag’s behavior and implications.
guides/hosting/configurations/shopware/environment-variables.md Improves the env-var reference entry to describe the real behavior and tradeoffs of SHOPWARE_ADMIN_ES_REFRESH_INDICES.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread guides/hosting/infrastructure/elasticsearch/elasticsearch-setup.md Outdated
Comment thread guides/hosting/configurations/shopware/environment-variables.md
Vin Le (vienthuong) and others added 2 commits August 21, 2026 16:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Guide Guides section of dev docs Product Products section of dev docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants