Semantic search


For each document in this collection, I have fields as such where the number of steps is varying, so the length of the array of the steps field varies as well, as it’s shown in the picture, that I want to have embeddings for each of the step name separately. For the part of making the search index and then attaching it to the step_embeddings ,
{
“fields”: [
{
“numDimensions”: 1536,
“path”: “”,
“similarity”: “cosine”,
“type”: “vector”
}
]
}
I’m not sure what to write in the path of the search index

Looks like it should just be steps.step_embeddings – you don’t need a specific syntax to reference the field in each array element.

1 Like

I’ve tried it but I’ve got this error in the status details:
Your index could not be built: Unexpected error: VectorValuesField “$type:knnVector/steps.step_embeddings” appears more than once in this document (only one value is allowed per field)

That’s true, my apologies, you cannot index more than one field per document. See https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#considerations

1 Like

So building the search index for such embeddings is not possible at all in Mongodb right?.. or is there any other way?