Installing RediSearch for ERPNext E-Commerce Search
ERPNext’s E-Commerce module can optionally use RediSearch to provide a faster and more intelligent product search experience. Once installed and enabled, RediSearch powers advanced search capabilities such as fuzzy matching, autocomplete, result ranking, and configurable search indexing.
Overview
- Enhances ERPNext product search with high-performance indexing.
- Supports fuzzy searches, autocomplete, and ranked search results.
- Requires Redis 6+ and a compatible RediSearch module.
- Must be installed separately before enabling it in E Commerce Settings.
RediSearch integration is considered experimental. Test thoroughly in a development or staging environment before deploying it to production.
Prerequisites
Before installing RediSearch, ensure your environment includes:
- A working Frappe Framework and ERPNext installation.
- Redis 6+ installed.
- Access to the server hosting your ERPNext instance.
- Permissions to compile software and modify Redis configuration.
Install RediSearch
Clone the RediSearch repository and build the module.
git clone --recursive https://github.com/RediSearch/RediSearch.git
cd RediSearch
sudo make setup
make build
On macOS, remove the sudo prefix while running the make setup command.
After a successful build, the compiled module file redisearch.so will be generated inside the following directory:
RediSearch/build/
Compatibility Notes
- The latest versions of RediSearch require Redis 7.1+.
- Many Linux package managers currently provide Redis 7.0 or earlier.
- You may need to compile Redis from source to ensure compatibility.
- ERPNext officially requires Redis 6+, so upgrading to Redis 7.1+ should be tested carefully before using it in production.
Install the RediSearch Module
Move the compiled module to a location that Redis can access.
sudo mv build/redisearch.so /etc/
The module may be stored in another directory if preferred. However, placing it in /etc simplifies future configuration and follows the recommended convention.
Load the Module Automatically
Open the Redis configuration file used by ERPNext:
<bench-directory>/config/redis_cache.conf
Add the following line before the save "" directive:
loadmodule /etc/redisearch.so
Save the configuration file and restart your Bench services.
Loading the module through the Redis configuration ensures RediSearch starts automatically whenever Redis is restarted.
Verify Module Installation
Connect to the Redis instance used by ERPNext. The default Redis cache port is typically 13000.
redis-cli -p 13000
Run the following command:
MODULE LIST
If the installation is successful, the returned list should include the search module.
Load the Module Without Restarting Redis
If Redis is already running, you can load the module manually without restarting the server.
MODULE LOAD /etc/redisearch.so
Manual loading only affects the current Redis session. To make the module persistent after a restart, add the loadmodule directive to the Redis configuration file.
Enable RediSearch in ERPNext
After confirming that the module has been loaded successfully, enable RediSearch from ERPNext.
E Commerce Settings
↓
Item Search Settings
↓
Enable Redisearch
Once enabled, ERPNext begins using RediSearch for Website Item searches.
Benefits of Using RediSearch
- High-performance product searches.
- Autocomplete suggestions.
- Fuzzy word matching for spelling mistakes.
- Search result ranking based on relevance.
- Configurable searchable fields.
- Improved scalability for large product catalogs.
Installing and enabling RediSearch significantly enhances ERPNext’s E-Commerce search by replacing standard database searches with a powerful indexing engine that delivers faster, more relevant, and more flexible search results for large online catalogs.