How can I create vector search index with more than 2048 dimensions on local deployment?

Hi,

I’m using the Docker image mongodb/atlas:v1.20.0, and it seems I’m unable to create a vector index with more than 2048 dimensions: MongoServerError: "userCommand.indexes[0].fields[0].numDimensions" must be within bounds

This is what I’ve tried:

const searchIndex = await MyModel.createSearchIndex({
  name: 'v1',
  // @ts-expect-error https://www.mongodb.com/docs/drivers/node/current/fundamentals/indexes/#create-a-search-index
  type: 'vectorSearch',
  definition: {
    fields: [
      {
        type: 'vector',
        path: 'embedding',
        numDimensions: 4096,
        similarity: 'euclidean', // cosine, euclidean, dotProduct
      },
    ],
  },
});

If I use MongoDB Compass I get the same error message:

From the documentation it looks like it should support up to 4096 dimensions. How can I make this work?

I am looking into it.

1 Like

I just took the new and shiny mongodb-atlas-local for a spin and it seems to work fine for that. I haven’t fully evaluated it to safely make the switch, though.