-
how does llama index query the redis, KNN or Range, what command does it use? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
LlamaIndex queries Redis using KNN (k-nearest neighbors). The command it uses is: base_query = f"{filters}=>[KNN {top_k} @{vector_field} $vector AS vector_score]" This command is part of the Additionally, LlamaIndex also supports querying using range filters. The |
Beta Was this translation helpful? Give feedback.
LlamaIndex queries Redis using KNN (k-nearest neighbors). The command it uses is:
This command is part of the
get_redis_query
function, which constructs a vector query for use with a SearchIndex. LlamaIndex supports two types of vector indexes in Redis: FLAT (brute force search) and HNSW (hierarchical navigable small world graph index).Additionally, LlamaIndex also supports querying using range filters. The
_metadatafilter_to_dict
function converts range filters into a dictionary format that can be used in the query. The_search_query_with_filter
function constructs a search query with pre-filter or post-fi…