Vector Search Dimension index number compared to query

Hello,

I am getting an error with the number of dimensions in my vector search compared to my index.

{
  "mappings": {
    "dynamic": true,
    "fields": {
      "aiLabelsVector": {
        "dimensions": 300,
        "similarity": "euclidean",
        "type": "knnVector"
      }
    }
  }
}

and my query looks like this

[
  {
    "$vectorSearch": {
      "index": "default",
      "path": "aiLabelsVector",
      "queryVector":[
          0.024552748, -0.015502235, -0.013485263, 0.012069505, -0.0027216184,
          0.023427898, -0.011920818, -0.03865862, ...
        ],  
      "numCandidates": 100,
      "limit": 10
    }
  }
]

The vector is 300 dimensions.

The error i get is MongoServerError: PlanExecutor error during aggregation :: caused by :: vector field is indexed with 300 dimensions but queried with 1536.

Hi @Nico_Herrera,

As per the queryVector field description:

Array of numbers of the BSON double type that represent the query vector. The array size must match the number of vector dimensions specified in the index definition for the field.

Can you double check the array size being passed through as the queryVector field?

Regards,
Jason