Redis Vector Similarity Search enables high-performance ANN search with HNSW indexes alongside Redis's traditional data structures. Understanding FT.CREATE syntax, KNN queries, and hybrid search is essential for building vector search applications on Redis.
0 / 5 completed
1 / 5
A developer creates a Redis vector index using FT.CREATE idx SCHEMA embedding VECTOR HNSW 6 TYPE FLOAT32 DIM 1536 DISTANCE_METRIC COSINE. What does HNSW specify?
HNSW (Hierarchical Navigable Small World) is a graph-based approximate nearest neighbor (ANN) algorithm that builds a multi-layer graph index. It offers excellent query speed with high recall. Redis also supports FLAT (brute-force exact search, better for small datasets). HNSW trades a small accuracy loss for dramatically faster search on large vector collections.
2 / 5
What is hybrid search in Redis VSS (Vector Similarity Search)?
Hybrid search in Redis VSS combines vector KNN search with standard filter predicates. For example, find the 10 documents most similar to a query vector WHERE category='electronics' AND price < 100. The filter is applied as a pre-filter or post-filter on the ANN search, enabling semantic search scoped to specific document subsets.
3 / 5
A developer stores vectors in Redis Hashes and runs FT.SEARCH idx '*=>[KNN 5 @embedding $query_vec]' PARAMS 2 query_vec $blob DIALECT 2. What does DIALECT 2 enable?
DIALECT 2 is required for Redis vector search queries because it enables the KNN vector search syntax ([KNN N @field $param]) and the PARAMS keyword for passing binary vectors. Without DIALECT 2, the vector search syntax is not recognized by the RediSearch query parser.
4 / 5
What does the EF_RUNTIME parameter control in an HNSW vector search query?
EF_RUNTIME (ef_search) controls the size of the dynamic candidate list maintained during HNSW graph traversal. Higher values explore more candidates, improving recall (finding the true nearest neighbors) at the cost of slower queries. EF_CONSTRUCTION is the analogous parameter that controls recall during index building.
5 / 5
A team stores documents as Redis JSON objects instead of Hashes for vector search. What change is needed in the FT.CREATE command?
To index JSON documents, the FT.CREATE command must specify ON JSON and use JSONPath expressions for field definitions (e.g., SCHEMA $.embedding AS embedding VECTOR HNSW ...). The AS embedding alias is used in queries. Without ON JSON, Redis assumes Hash data structures.