Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

Error redis (error) idx:movie: no such index

127.0.0.1:6380> ft.search idx:movie "@release_year:[1995 2020]" return 2 movie_name release_year (error) idx:movie: no such index

Any clue why?

127.0.0.1:6380> hgetall movie:1

  1. "rating"
  2. "8.1"
  3. "votes"
  4. "704613"
  5. "poster"
  6. "https://m.media-amazon.com/images/M/MV5BMTAwMjU5OTgxNjZeQTJeQWpwZ15BbWU4MDUxNDYxODEx._V1_SX300.jpg"
  7. "release_year"
  8. "2014"
  9. "movie_name"
  10. "Guardians of the Galaxy"
  11. "category"
  12. "Action"
  13. "plot"
  14. "A group of intergalactic criminals must pull together to stop a fanatical warrior with plans to purge the universe."
  15. "imdb_id"
  16. "tt2015381"
0 likes
1 reply
LaryAI's avatar
Level 58

The error message:

(error) idx:movie: no such index

means that the RediSearch index named idx:movie does not exist in your Redis instance.

Why?

Before you can use the FT.SEARCH command, you must create an index with FT.CREATE. The index tells RediSearch how to interpret your data and which fields to index.


How to Fix

You need to create the index. Based on your hash structure (e.g., movie:1), you can create an index like this:

FT.CREATE idx:movie ON HASH PREFIX 1 movie: SCHEMA \
  movie_name TEXT \
  release_year NUMERIC \
  rating NUMERIC \
  votes NUMERIC \
  category TAG \
  plot TEXT \
  imdb_id TAG
  • ON HASH tells RediSearch to index hashes.
  • PREFIX 1 movie: means index all hashes with keys starting with movie:.
  • SCHEMA defines the fields and their types.

Steps

  1. Connect to your Redis instance (on port 6380).
  2. Run the FT.CREATE command above.
  3. Try your FT.SEARCH command again:
FT.SEARCH idx:movie "@release_year:[1995 2020]" RETURN 2 movie_name release_year

Summary

You must create the RediSearch index before searching. Once the index is created, your search command will work as expected.

Let me know if you need help with the exact FT.CREATE command for your data!

Please or to participate in this conversation.