Ivan
02/07/2025, 8:17 PM{
name: 'embedding',
type: 'float[]',
num_dim: 1536, // model uses 1536 dimensions
optional: true
}
When I view my current schema in Typesense, I see:
{
"facet": false,
"hnsw_params": {
"M": 16,
"ef_construction": 200
},
"index": true,
"infix": false,
"locale": "",
"name": "embedding",
"num_dim": 1536,
"optional": true,
"sort": false,
"stem": false,
"store": true,
"type": "float[]",
"vec_dist": "cosine"
},
Current Testing/ Debugging
In my current process that isn't working, when a user inputs a query, I make a call to OAI with the text-embedding-3-small
model to get the vector query which I insert into the search query object.
Every time I've sent this request or similar (see below), I keep getting 0 products returned.
Complete Typesense Request:
{
"searches": [
{
"collection": "product-embeddings-v2",
"q": "*",
"vector_query": "embedding:([ {vector query from OAI} ], k:200)",
"exclude_fields": "embedding",
"sort_by": "averageRating:desc",
"per_page": 24
}
]
}
I then decided to query the products themselves directly to see what fields they have and I do not see embedding
being returned as a field which is probably why I'm getting 0 products when attempting a vector_query search.
Does anyone know what might be happening here? Thanks!