Which Redis command creates a vector index supporting KNN search over a HASH field?
- A FT.CREATE idx ON HASH SCHEMA vec VECTOR HNSW 6 TYPE FLOAT32 DIM 1536 DISTANCE_METRIC COSINE (correct answer)
- B SET idx vector
- C ZADD idx 0 vec
- D JSON.SET idx $ vec
Shortcut: CREATE with a VECTOR field defines the algorithm (HNSW or FLAT) plus TYPE, DIM, and DISTANCE_METRIC. The attribute count must match the number of parameters supplied.
FT.CREATE with a VECTOR field defines the algorithm (HNSW or FLAT) plus TYPE, DIM, and DISTANCE_METRIC. The attribute count must match the number of parameters supplied.