Embedding and VectorSearch

Hello everyone,
I am working in a project as backend dev and iam using embeddings hugginface interface and i just want to extract a text from PDF and store these chunks after extraction and store the document with its array of chunks and array of its embedded chucks
The Question here is how to use Atlas search to search through an array of embedded chunks and return the most 5 relative searches with their scores

Hi @Searg_eldien_Mahmoud and welcome to MongoDB community forums!!

Based on the above statement, I believe this is how you expect your document to look like

{
  "_id": ObjectId("5fb3c0a15ab05412dc4ad21f"),
  "documentId": "123456",
  "documentName": "Sample Document",
  "textArray": ["text1", "text2", "text3"]
}

If my understanding is correct, unfortunately, this is currently not supported. If your database schema matching with above, you would probably have to rethink the schema design to work with knnBeta.
Please refer to the documentations for knnBeta Limitation for more details.

However, if you have a different sample document design, could you help me with the sample documents and the desired results from the query.

Regards
Aasawari