| VectorCache | R Documentation |
Specialized cache for vector search results
Features:
Query result caching
Vector embedding caching
Automatic cache invalidation
prefixCache key prefix
new()Create a new VectorCache
VectorCache$new(cache, prefix = "vec:")
cacheBase cache backend
prefixKey prefix (default: "vec:")
get_search_results()Get cached search results
VectorCache$get_search_results(collection, query, filter = NULL, limit = 10)
collectionCollection name
queryQuery vector
filterFilter conditions
limitResult limit
Cached results or NULL
set_search_results()Cache search results
VectorCache$set_search_results( collection, query, results, filter = NULL, limit = 10, ttl = 300 )
collectionCollection name
queryQuery vector
resultsSearch results
filterFilter conditions
limitResult limit
ttlTime to live (default: 300)
get_vector()Get cached vector
VectorCache$get_vector(collection, vector_id)
collectionCollection name
vector_idVector ID
Cached vector data or NULL
set_vector()Cache vector data
VectorCache$set_vector(collection, vector_id, data, ttl = 3600)
collectionCollection name
vector_idVector ID
dataVector data
ttlTime to live (default: 3600)
invalidate_vector()Invalidate cached vector
VectorCache$invalidate_vector(collection, vector_id)
collectionCollection name
vector_idVector ID
stats()Get cache statistics
VectorCache$stats()
CacheStats object
clone()The objects of this class are cloneable with this method.
VectorCache$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.