Ayush Pratap Singh
09/20/2023, 9:19 AMtest
{
"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
{
"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
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