{"record":{"id":"22763cdc78c07c64","repo":"MemPalace/mempalace","slug":"milvus-collection-self-collection-name-r-expect-22763c","errorCode":null,"errorMessage":"milvus collection {self._collection_name!r} expects embedding dimension {self._known_dimension}, got {int(q.size)}","messagePattern":"milvus collection (.+?) expects embedding dimension (.+?), got (.+?)","errorType":"exception","errorClass":"DimensionMismatchError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/milvus.py","lineNumber":647,"sourceCode":"                num_queries=len(query_embeddings),\n                embeddings_requested=bool(include and \"embeddings\" in include),\n            )\n        spec = _IncludeSpec.resolve(include, default_distances=True)\n        output_fields = self._output_fields(spec)\n        filter_expr = _combine_filter(\n            translate_where(where), translate_where_document(where_document)\n        )\n        outer_ids: list[list[str]] = []\n        outer_docs: list[list[str]] = []\n        outer_metas: list[list[dict]] = []\n        outer_dists: list[list[float]] = []\n        outer_embeddings: list[list[list[float]]] = []\n        for query_vector in query_embeddings:\n            q = _as_vector_array(query_vector)\n            if self._known_dimension is None:\n                self._known_dimension = self._remote_dimension()\n            if self._known_dimension is not None and int(q.size) != self._known_dimension:\n                raise DimensionMismatchError(\n                    f\"milvus collection {self._collection_name!r} expects \"\n                    f\"embedding dimension {self._known_dimension}, got {int(q.size)}\"\n                )\n            kwargs = {\n                \"collection_name\": self._remote_collection,\n                \"data\": [q.astype(float).tolist()],\n                \"limit\": int(n_results),\n                \"output_fields\": output_fields,\n                \"anns_field\": FIELD_VECTOR,\n                \"search_params\": {\"metric_type\": \"COSINE\"},\n                \"consistency_level\": self._config.consistency_level,\n            }\n            if filter_expr:\n                kwargs[\"filter\"] = filter_expr\n            raw = self._client.search(**kwargs)\n            hits = raw[0] if raw else []\n            rows = [self._row_from_search_hit(hit) for hit in hits]\n            outer_ids.append([row[FIELD_ID] for row in rows])","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/milvus.py#L629-L665","documentation":"Error \"milvus collection {self._collection_name!r} expects embedding dimension {self._known_dimension}, got {int(q.size)}\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/milvus.py:647 when the library encounters an invalid state.","commonSituations":"Query embedding dimension does not match the collection's stored dimension after a model swap.","solutions":["Re-embed the palace with the matching model or recreate the collection with the expected dimension"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}