create_vector_index_hash
Set up a Redis index for approximate nearest neighbor (ANN) search using the HNSW algorithm and float32 vector embeddings stored in a Redis hash.
Instructions
Create a Redis 8 vector similarity index using HNSW on a Redis hash.
This function sets up a Redis index for approximate nearest neighbor (ANN) search using the HNSW algorithm and float32 vector embeddings.
Args: index_name: The name of the Redis index to create. Unless specifically required, use the default name for the index. prefix: The key prefix used to identify documents to index (e.g., 'doc:'). Unless specifically required, use the default prefix. vector_field: The name of the vector field to be indexed for similarity search. Unless specifically required, use the default field name dim: The dimensionality of the vectors stored under the vector_field. distance_metric: The distance function to use (e.g., 'COSINE', 'L2', 'IP').
Returns: A string indicating whether the index was created successfully or an error message.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
dim | No | ||
distance_metric | No | COSINE | |
index_name | No | vector_index | |
prefix | No | doc: | |
vector_field | No | vector |