Skip to content

Scope OpenSearch/Elasticsearch index prefix to project name - #111

Merged
peterjaap merged 1 commit into
qoliber:mainfrom
Aquive:feature/opensearch-prefix-scoping
May 12, 2026
Merged

peterjaap merged 1 commit into
qoliber:mainfrom
Aquive:feature/opensearch-prefix-scoping

Conversation

@Aquive

@Aquive Aquive commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Multiple MageBox projects share a single OpenSearch/Elasticsearch Docker instance (port 9200). The docs and magebox new were hardcoding magento2 as the index prefix everywhere. When two projects use the same prefix, a reindex on one project overwrites the indices of the other.

Changes

cmd/magebox/new.go

  • Interactive wizard: the displayed setup:install command now uses the project name as --opensearch-index-prefix / --elasticsearch-index-prefix
  • Quick install (--quick flag): the actual setup:install execution now passes the project name as the index prefix

Docs

  • vitepress/services/opensearch.md — replaced magento2 with myproject in all prefix examples; added :::warning callout explaining the shared-instance problem
  • vitepress/guide/search.md — same warning callout + replaced magento2 with myproject in all Magento configuration examples
  • vitepress/guide/quick-start.md — replaced --opensearch-index-prefix=magento2 with mystore (matching the example project name used throughout that page)

Multiple MageBox projects share one Docker search engine instance, so a
hardcoded 'magento2' prefix causes index collisions across projects.

- new.go: pass projectName as index prefix in both the interactive wizard
  (displayed setup:install command) and the quick-install execution path
- docs: replace 'magento2' prefix with project-name placeholders in
  opensearch.md, search.md, and quick-start.md; add warning callout
  explaining why a project-scoped prefix is required
@jakwinkler

Copy link
Copy Markdown
Contributor

@peterjaap I'm fine with merging it

@peterjaap

Copy link
Copy Markdown
Collaborator

Great stuff

@peterjaap
peterjaap merged commit f862322 into qoliber:main May 12, 2026
9 checks passed
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.

3 participants