The error (error) ERR unknown command 'ft.search' means that your Redis server does not recognize the ft.search command. This command is part of the RediSearch module, which is not included in Redis by default.
How to fix:
-
Install RediSearch Module
-
If you are using Redis Stack, RediSearch is included by default. You can download and run Redis Stack from here.
-
If you are using plain Redis, you need to install RediSearch as a module:
- Download the RediSearch module from the official releases.
- Start Redis with the module:
redis-server --loadmodule /path/to/redisearch.so - Or, if you already have a running Redis server, you can add the following line to your
redis.conf:loadmodule /path/to/redisearch.so
-
-
Verify Installation
Connect to your Redis server and run:
FT._LISTIf you get a list of indexes (or an empty array), RediSearch is installed.
-
Try Your Command Again
Now you should be able to run:
FT.SEARCH idx:movie "@release_year:[1995 2000]" RETURN 2 movie_name release_year
Summary:
You are getting this error because RediSearch is not installed or enabled on your Redis server. Install Redis Stack or the RediSearch module, and your ft.search command will work.