ProductSearchRoute
, ProductListingRoute
and ProductSuggestRoute
. To use elasticsearch on your own searches make sure to add the elasticsearch aware state to your criteria.SHOPWARE_ES_THROW_EXCEPTION=1
ElasticsearchDefinition
needs to be added. Currently, Shopware has such a definition for the product entity called ProductElasticsearchDefinition
. This definition defines the fields which are provided to elasticsearch and how they are aggregated.ElasticsearchEntitySearcher
decorates the EntitySearcher
to map the entity search to the elasticsearch structure. The ElasticsearchEntitySearcher
returns an IdSearchResult
hydrated by the ElasticsearchEntitySearchHydrator
as the EntitySearcher
does and this result is used to read the found ids from the database.ElasticsearchEntityAggregator
does the same as the ElasticsearchEntitySearcher
for aggregations.CriteriaParser
parses the criteria to an elasticsearch specific notation.ProductSearchBuilder
in the core and so has the elasticsearch extension a corresponding extension for the ProductSearchBuilder
. This extension matches the queries of the core ProductSearchBuilder
to the elasticsearch notation.ProductUpdater
listens to the ProductIndexerEvent
and triggers the ElasticsearchIndexer
on changes to a ProductEntity
es:index:cleanup
deletes outdated elasticsearch indexes. The parameter -f
will skip the confirmation.es:create:alias
refreshes the current elasticsearch index and sets the alias to the index name without the timestamp (which will make this index the active index). This will happen automatically when a new index is published, so this command can force the alias creation for testing purposes or if something went wrong.es:index
re-indexes all configured entities to elasticsearch.es:reset
resets all active indices and clears the queue. This command should be used only if an index is corrupted or needs to be setup completely from scratch.es:status
returns the status of all current elasticsearch indices.es:test:analyzer
runs an elasticsearch analyzer on your indices. For more details on elasticsearch analyzers take a look on the elasticsearch reference (external link).