My MongoDB vCore vector search aggregation stopped returning results overnight.

Marco Aurelio Freitas (P) 15 Reputation points
2023-06-13T19:37:13.34+00:00

My node.js aggregation clause for vector search stopped returning values overnight. Yesterday I was getting results successfully when running the aggregation in my database with cosine similarity. Today, the same aggregation with no changes at all only returns an empty array. What could be the cause of this problem and how can I fix it?

collection.aggregate([
    {
      $search: {
        cosmosSearch: {
          vector: vector.values,
          path: "vectorContent",
          k: 5,
        },
        returnStoredSource: true,
      },
    },
  ])
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,901 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Marco Aurelio Freitas (P) 15 Reputation points
    2023-08-04T12:33:07.24+00:00

    Thanks for the replies!

    Turns out it was an error in my code. I was always creating the Vector Search Index passing the wrong path to the vector values. It was working in Python, but when I wrote the API in Node.js, I made this mistake and only realized it later on. Sorry for the lack of feedback, but the problem was solved later that day or the day before, so everything is working just fine now.

    This validation bug that you mentioned was getting in my way as well, but I could manage to work around it through the Azure CLI. I created the resource via a bicep file.

    Everything is in order! Thanks for the support.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.