If you are preparing a migration or fresh install of Shopware 6.7, the first thing you must understand is that the era of native Elasticsearch support has concluded. As of Shopware 6.5, Elasticsearch was deprecated, and by Shopware 6.7, it has been fully removed from the core framework. The search infrastructure now relies exclusively on OpenSearch.
Attempting to configure Elasticsearch in Shopware 6.7 will result in critical failures because the FIND command pattern and search adapters no longer recognize legacy ES connections. This guide provides the definitive setup for OpenSearch in Shopware 6.7, ensuring your store leverages the modern search engine required for performance, relevance, and stability.
Why the Shift to OpenSearch?
Shopware transitioned to OpenSearch due to community alignment, enhanced performance tuning capabilities, and long-term maintainability. OpenSearch is a fork of Elasticsearch that offers better compatibility with open standards and avoids licensing restrictions. Shopware 6.7's search bundle (Shopware\Core\Framework\Adapter\OpenSearch) is optimized for the latest syntax and indexing behaviors specific to version 6.7's data model.
Prerequisites
Before proceeding, ensure you have:
- Docker or access to a cloud OpenSearch service (e.g., AWS OpenSearch, Elastic Cloud).
- Shopware 6.7 project ready with Composer dependencies installed.
- Root/Admin access to the Shopware instance for environment configuration.
Step 1: Local Development Setup with Docker
For development and staging, Docker Compose is the recommended approach. Below is a robust configuration that includes health checks, persistent storage, and security best practices for local use.
Create a docker-compose.yml in your project root:
version: '3.8'
services:
opensearch:
image: opensearchproject/opensearch:2.11.0 # Use latest LTS compatible with SW 6.7
container_name: shopware-opensearch
environment:
- discovery.type=single-node
# Security is disabled for dev only! Production MUST use users and TLS.
- plugins.security.disabled=true
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g" # Adjust based on RAM
volumes:
- opensearch_data:/usr/share/opensearch/data
- ./opensearch/config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml
ports:
- "9200:9200"
- "9600:9600"
networks:
- shopware-net
# Optional: Opensearch Dashboards for visualization
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:2.11.0
ports:
- "5601:5601"
environment:
- OPENSEARCH_HOSTS=["http://opensearch:9200"]
depends_on:
- opensearch
networks:
- shopware-net
volumes:
opensearch_data:
driver: local
networks:
shopware-net:
driver: bridge
Important Note: The plugins.security.disabled=true flag is strictly for development. In production, you must configure OpenSearch users, roles, and TLS certificates. Shopware supports SSL/TLS connections via environment variables (see below).
Step 2: Shopware Environment Configuration
Shopware 6.7 reads search configuration from the .env file or your hosting environment. While older guides reference SHOPWARE_ES_ variables, Shopware 6.7 expects OpenSearch-specific variables. The core automatically maps these to the OpenSearch adapter.
Update your .env:
# Search Configuration
OPEN_SEARCH_HOSTS=opensearch:9200
OPEN_SEARCH_INDEX_PREFIX=sw67
OPEN_SEARCH_USER=admin
OPEN_SEARCH_PASSWORD=s3curePass123! # Set a strong password in prod
OPEN_SEARCH_SSL_VERIFY=true # Enable TLS verification in production
# Performance Tuning
SHOPWARE_SEARCH_BATCH_SIZE=500
Variable Breakdown:
OPEN_SEARCH_HOSTS: Comma-separated list of nodes (e.g.,host1:9200,host2:9200).OPEN_SEARCH_INDEX_PREFIX: Avoids naming collisions; recommended to include version identifier.OPEN_SEARCH_SSL_VERIFY: Set totrueif using self-signed or CA certificates in production.SHOPWARE_SEARCH_BATCH_SIZE: Controls how many entities are indexed per transaction. Increase for large catalogs but monitor memory usage.
Step 3: Verifying Connection and Indexing
Once configured, verify connectivity via the command line:
# Check if Shopware detects the OpenSearch node
bin/search:index-status
# Run a dry run to validate configuration without writing data
bin/search:index --dry-run
# Execute full indexing (Products, Categories, Sales Channels)
bin/search:index
After indexing, generate sales channel specific search configs:
bin/sales-channel:search:generate
If search:index-status returns an error, check your network policies. OpenSearch port 9200 must be accessible from the Shopware container or server IP.
Step 4: Customizing Search in Shopware 6.7
Shopware 6.7 allows deep customization of analyzers and field boosting via configuration files. This is crucial for handling local dialects, synonyms, or specific product attributes.
Create src/Resources/config/shopware_search.config.yaml:
shopware_search:
indices:
product:
settings:
analysis:
filter:
sw_product_synonyms:
type: synonym
synonyms:
- phone, smartphone, mobile
- laptop, notebook
analyzer:
sw_custom_analyzer:
tokenizer: standard
filter: [lowercase, sw_product_synonyms, asciifolding]
mappings:
fields:
name.boost: 2.5
description.boost: 1.0
product_number.boost: 3.0
This configuration introduces a synonym filter and boosts the product_number field heavily, ensuring that SKU searches return results immediately even with partial matches. Clear cache after changes:
bin/cache:clear
bin/search:index
Step 5: Production Hardening & Best Practices
- Security: Never expose OpenSearch to the public internet without authentication. Use security groups/firewalls to restrict access to Shopware nodes only. Enable
plugins.security.disabled=falseand configure SSL/TLS in your OpenSearch YAML. - Snapshots: Configure a snapshot repository for backups. Shopware does not automate snapshots; rely on infrastructure-level backup strategies.
- Scaling: For high-traffic stores, use a multi-node OpenSearch cluster with dedicated master nodes. Shopware supports cluster failover if
OPEN_SEARCH_HOSTSincludes multiple nodes. - Index Maintenance: Periodically run
bin/search:optimizeto compact indices and reclaim space during low traffic windows.
Troubleshooting Common Issues
- Connection Refused: Verify
OPEN_SEARCH_HOSTSDNS resolution. Docker internal names must match service definitions. - 403 Forbidden: Check
OPEN_SEARCH_USERandOPEN_SEARCH_PASSWORD. In OpenSearch 2.x+, the default user may differ. Ensure the user hasmanage,monitor, andall_cluster_privilegesroles. - Mapping Errors: If you see mapping exceptions, your prefix may conflict with previous versions. Delete indices via API and reindex, or change
OPEN_SEARCH_INDEX_PREFIX. - SSL Handshake Failures: If using custom certs, ensure
shopware_opensearch_ca_cert_pathis set if certificates are not system-trusted.
Conclusion
Shopware 6.7 demands OpenSearch for search functionality. While the transition from Elasticsearch requires updating your infrastructure and environment variables, the result is a more robust, performant, and future-proof search experience. By following this guide, you ensure your Shopware 6.7 instance is configured correctly, secure, and ready to handle complex catalog requirements with modern search capabilities. Always consult the official Shopware Documentation for Search for version-specific nuances and advanced adapter customization options.