Elasticsearch
Provide powerful indexing and searching features in your commerce application with Elasticsearch.
Features
- Flexible configurations for specifying searchable and retrievable attributes.
- Utilize Elasticsearch's powerful search functionalities including possibility to configure custom mappings, indexes, tokenizers and more.
Prerequisites
- Medusa backend
- Elasticsearch instance or cloud
How to Install
1. Run the following command in the directory of the Medusa backend:
2. Set the environment variables in
, based on your configuration.Copy to clipboard.env
3. In
add the following at the end of theCopy to clipboardmedusa-config.js
array:Copy to clipboardplugins
Options
1. Global options
Name | Description | Required |
---|---|---|
| The Elasticsearch client configuration. | true |
| The indexes list and configurations. | true |
2. Index Options
Name | Description | Required |
---|---|---|
| Standard Medusa index settings. | true |
| Custom object transformer function. | false |
| Custom Elasticsearch mapping configuration. | false |
| Custom Elasticsearch index configuration. | false |
Test the Plugin
1. Run the following command in the directory of the Medusa backend to run the backend:
2. Try searching products either using your storefront or using the Store APIs.
3. Example search response:
Additional Resources

Build your own plugins
Develop your own plugins with our API to speed up your processes.
Make your plugin available via npm for it to be shared in our Plugin Library with the broader Medusa community.
.png)