Set up product search
Every product listing page has a search bar. Customers search for Website Items and item groups, and can reuse their recent searches. By default, the webshop searches the database. You can use RediSearch for faster search instead.
INFO
Product search comes with the webshop app.
WARNING
RediSearch support is experimental. It needs Redis 6 or later.
Choose the searchable fields
- Open Webshop Settings, and find the item search settings.
- In Search Index Fields, enter the field names to search, separated by commas, for example
brand. A search for "Apple" then finds the items of the brand Apple. - Save.
The supported field types are Link, Table MultiSelect, Data, Small Text, and Text Editor.
Install RediSearch
RediSearch adds fuzzy search, autocomplete, ranking, and field indexing. Do these steps on the server, as a system administrator.
Build RediSearch:
bashgit clone --recursive https://github.com/RediSearch/RediSearch.git cd RediSearch sudo make setup # without sudo on macOS make buildThe build creates
redisearch.soin theRediSearch/builddirectory.Move the module to
/etc:bashsudo mv build/redisearch.so /etc/In the bench directory, open
config/redis_cache.conf. Add this line before thesave ""line:textloadmodule /etc/redisearch.soRestart the bench.
Check that Redis loaded the module. Run
redis-cli -p 13000(13000 is the default cache port of a bench), then:textMODULE LISTThe list contains
search.
WARNING
The latest RediSearch needs Redis 7.1 or later, which some package repositories do not offer. Use Redis 7.1 or later with care. Learn more in the RediSearch installation guide.
Turn on RediSearch
- In Webshop Settings, select Enable Redisearch.
- Save.