Domain 2 of 4 · Chapter 6 of 12

Implement Azure Managed Redis vector indexing for similarity search

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing Developing AI Cloud Solutions on Azure premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • Three commitments, and when each one freezes
  • The provisioning gate: module, policy, tier
  • Defining the index: ON type, PREFIX, and SCHEMA
  • FLAT or HNSW, and what the tuning buys you
  • Storing vectors: hash bytes or JSON arrays
  • Running a vector query
  • Hybrid search and how a filter is really applied
  • Changing your mind: alter, rebuild, and drop
  • Exam-pattern recognition

Which modules each Azure Managed Redis tier offers

ModuleMemory OptimizedBalancedCompute OptimizedFlash Optimized
RediSearch (vector search)YesYesYesNo
RedisBloomYesYesYesNo
RedisTimeSeriesYesYesYesNo
RedisJSONYesYesYesYes

Decision tree

RediSearch enabled at creation?noyesNew instance requiredEnterprise policy + NoEviction?noyesNew instance: policies fixedOver 1M vectors or latency-bound?noyesFLAT indexHNSW, tune EF_RUNTIMEFixed k, or a distance cutoff?fixed kdistance cutoffKNN + LIMIT 0 k + SORTBYVECTOR_RANGE query

Cheat sheet

  • Azure Managed Redis enables vector search through the RediSearch module and an FT.CREATE index
  • A VECTOR field declares the algorithm (FLAT or HNSW), TYPE, DIM, and DISTANCE_METRIC
  • FLAT is exact brute-force search; HNSW is an approximate graph index for large, low-latency workloads
  • HNSW recall and latency are tuned by M, EF_CONSTRUCTION, and EF_RUNTIME
  • A KNN vector query uses FT.SEARCH with the =>[KNN k @field $vec] syntax and DIALECT 2
  • The query vector is passed as raw bytes through PARAMS, and SORTBY is what orders results by distance
  • Hybrid queries put a RediSearch filter in front of the KNN clause, and Redis decides how to apply it
  • RediSearch supports three vector distance metrics: COSINE, L2 (Euclidean), and IP (inner product)
  • DISTANCE_METRIC, TYPE, and DIM are fixed at index creation and must match the stored and query vectors
  • COSINE ranks by orientation rather than magnitude, the usual choice for text embeddings
  • Embeddings are stored in HASH fields as raw float32 bytes or in JSON as numeric arrays, matching the index ON type
  • A key PREFIX defines which keys are indexed; matching keys are indexed automatically on write
  • redis-py exposes vector search via its search commands (VectorField, Query) over FT.CREATE/FT.SEARCH
  • RediSearch on Azure Managed Redis requires the Enterprise clustering policy and is not offered on every tier

Unlock with Premium — includes all practice exams and the complete study guide.

Also tested in

References

  1. Using Redis modules with Azure Managed Redis
  2. FT.ALTER
  3. What is Azure Managed Redis?
  4. About Vector Embeddings and Vector Search in Azure Managed Redis
  5. FT.CREATE
  6. Key eviction
  7. Vector search concepts
  8. FT.INFO
  9. Redis as a vector database quick start guide
  10. Query dialects
  11. FT.DROPINDEX