This message was deleted.
# community-help
s
This message was deleted.
k
1. Yes old documents will be processed and embeddings will be generated for them. This is a blocking operation and could take some time depending on your collection size. 2. Yes. Since the parent api keys will be persisted, the scoped api keys will continue working (they are derived from parent keys and is generated client side)
a
More on the first point if we try to update an already existing collection with a new field , it has to be set as optional right ? So on testing it isn't working ? Is there any other way to update the collection to add a embedding field?
Further a question how would we insure the keys are persisted, like moving the old data from the old instance ? Also is there a server version migration guide in docs ?
k
You can add an existing field as either optional or non-optional. For addition of embeddings field, there were some bugs in 0.25.0 which is fixed in 0.25.1 so it should work on that. During upgrade as long as you stop the server and make the new version point to the same data directory it will work.
a
Thanks for the help. About auto generating embeddings for old documents in a collection I'm trying on 0.25.1 ( docker ) , Just had one single document previously and updated the collection to add an auto-embeddeding , been a while it still hasn't updated .
k
Please post the exact commands you did
a
Sure . Previously had a collection named
test
Copy code
{
  "created_at": 1695201038,
  "default_sorting_field": "",
  "enable_nested_fields": false,
  "fields": [
    {
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "word",
      "optional": false,
      "sort": false,
      "type": "string"
    }
  ],
  "name": "test",
  "num_documents": 1,
  "symbols_to_index": [],
  "token_separators": []
}
with a single document
Copy code
{
  "facet_counts": [],
  "found": 1,
  "hits": [
    {
      "document": {
        "id": "0",
        "word": "help"
      },
      "highlight": {},
      "highlights": []
    }
  ],
  "out_of": 1,
  "page": 1,
  "request_params": {
    "collection_name": "test",
    "per_page": 10,
    "q": "*"
  },
  "search_cutoff": false,
  "search_time_ms": 0
}
Updated to add a field
embedding
Copy code
curl "http://localhost:8108/collections/test" \
       -X PATCH \
       -H "Content-Type: application/json" \
       -H "X-TYPESENSE-API-KEY:xyz" \
       -d '{
         "fields": [

                      {
                "embed": {
                    "from": [
                        "word"
                    ],
                    "model_config": {
                    "api_key": "sk-***************",
                        "model_name": "openai/text-embedding-ada-002"
                    }
                },
                "facet": false,
                "index": true,
                "infix": false,
                "locale": "",
                "name": "embedding",
                "num_dim": 1536,

                "sort": false,
                "type": "float[]"
            }  
         ]
       }'
Now if i upsert any new document that automatically gets an embedding field . But the old single document hasn't updated in quite a while Running v0.25.1 on docker
k
Ok will look and get back to you.
a
Hei @Kishore Nallan just checking any updates on this ?
k
Yes, I checked again and it turns out they we only support reindexing of non auto embedded vector fields during alter. We are working to support embedded fields as well now.