Vectors caching #858
                  
                    
                      bpolaszek
                    
                  
                
                  started this conversation in
                Feedback & Feature Proposal
              
            Replies: 1 comment
-
| 
         Hello @bpolaszek  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following document:
{ "id": 1, "productId": "A" "name": "Unicorn T-shirt" "color": "Red" "size": "L" }Consider I have an embedder with
documentTemplateset as{{doc.color}} {{doc.name}}. It will generate embeddings forRed Unicorn T-shirt.Now, if I add the following document:
{ "id": 2, "productId": "A" "name": "Unicorn T-shirt" "color": "Red" "size": "S" }In this case, Meilisearch would also call the embedder to get vectors for
Red Unicorn T-shirt.Which would be the same as the 1st product variant.
On huge catalogs with lots of variants, tons of embedder calls could be avoided if some cache mechanism were implemented. The cache key would be sth like
sha1(resolve(documentTemplate))-sha1(embedderSettings)(unsure if the index name should be part of it). That cache key would be stored along with each document (meaning, the last document holding the hash being deleted would also delete the cache entry, for example).WDYT?
Beta Was this translation helpful? Give feedback.
All reactions