#5646·FerretDB

field cannot have more than 2000 dimensions for vector index

Author: perdacherMartinCreated May 8, 2026Updated May 11, 2026
Labelscode/bugnot ready

FerretDB, PostgreSQL, and DocumentDB versions

  • postgres: ghcr.io/ferretdb/postgres-documentdb:17-0.107.0-ferretdb-2.7.0
  • ferretdb: ghcr.io/ferretdb/ferretdb:2.7.0

The FerretDB documentation states, that it supports dimensions for embeddings of sizes up to 16000.

Unfortunately I get the error: "field cannot have more than 2000 dimensions for vector index"

Here the syntax for Pymongo indexing:

python
client = MongoClient("mongodb://username:password@localhost:27017")
db = client["test"]
db.command({
    "createIndexes": "embeddings",
    "indexes": [
        {
            "name": "vector_hnsw_index",
            "key": {
                "vector": "cosmosSearch"
            },
            "cosmosSearchOptions": {
                "kind": "vector-hnsw",
                "similarity": "COS",
                "dimensions": 4096,
                "m": 16,
                "efConstruction": 200
            }
        }
    ]
})

I tried also other combinations of efConstruction.

Environment

  • OS: Ubuntu 22.04 x86_64
  • Deployment: Attached Docker Compose file
  • Deployment details: Docker version 28.5.1
  • Pymongo: 4.15.3

docker-compose-ferretdb.yaml

What did you do?

tried to create an index to store embeddings.

What did you expect to see?

That it supports index creation up to 16k, as stated in the documentation.

What did you see instead?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/_csot.py", line 125, in csot_wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/database.py", line 953, in command
    return self._client._retryable_read(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/mongo_client.py", line 2076, in _retryable_read
    return self._retry_internal(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/_csot.py", line 125, in csot_wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/mongo_client.py", line 2038, in _retry_internal
    ).run()
      ^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/mongo_client.py", line 2811, in run
    res = self._read() if self._is_read else self._write()
          ^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/mongo_client.py", line 3043, in _read
    return self._func(self._session, self._server, conn, read_pref)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/database.py", line 941, in inner
    return self._command(
           ^^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/database.py", line 778, in _command
    return conn.command(
           ^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/helpers.py", line 53, in inner
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/pool.py", line 403, in command
    return command(
           ^^^^^^^^
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/synchronous/network.py", line 212, in command
    helpers_shared._check_command_response(
  File "/home/boraas/index_ferret/.venv/lib/python3.12/site-packages/pymongo/helpers_shared.py", line 284, in _check_command_response
    raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: Error in specification { "name" : "vector_hnsw_index", "key" : { "vector" : "cosmosSearch" }, "cosmosSearchOptions" : { "kind" : "vector-hnsw", "similarity" : "COS", "dimensions" : 4096, "m" : 16, "efConstruction" : 32 } } :: caused by :: field cannot have more than 2000 dimensions for vector index, full error: {'ok': 0.0, 'errmsg': 'Error in specification { "name" : "vector_hnsw_index", "key" : { "vector" : "cosmosSearch" }, "cosmosSearchOptions" : { "kind" : "vector-hnsw", "similarity" : "COS", "dimensions" : 4096, "m" : 16, "efConstruction" : 32 } } :: caused by :: field cannot have more than 2000 dimensions for vector index', 'code': 67, 'codeName': 'CannotCreateIndex'}