{"record":{"id":"68f82fd6c96a4e2d","repo":"RyanCodrai/turbovec","slug":"document-doc-id-r-has-no-embedding-turboquantdo","errorCode":null,"errorMessage":"Document {doc.id!r} has no embedding. TurboQuantDocumentStore only stores documents with precomputed embeddings — run an embedder component before writing.","messagePattern":"Document (.+?) has no embedding\\. TurboQuantDocumentStore only stores documents with precomputed embeddings — run an embedder component before writing\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/haystack.py","lineNumber":266,"sourceCode":"            # stays persisted — a partial write. Mirror that observable\n            # state exactly: validate and commit per document, raising on\n            # the first collision. A repeated id within a single call\n            # collides with its already-committed first instance, the same\n            # way a cross-call repeat would. Each individual commit is\n            # still all-or-nothing — validation precedes any mutation, so\n            # a failing document mid-batch never leaves the index and the\n            # id maps inconsistent (#89/#139 apply per document).\n            written = 0\n            for doc in documents:\n                if doc.id in self._str_to_u64:\n                    # Checked before embedding validation: the reference\n                    # raises DuplicateDocumentError for a colliding id\n                    # regardless of the document's other fields.\n                    raise DuplicateDocumentError(\n                        f\"ID '{doc.id}' already exists in the document store.\"\n                    )\n                if doc.embedding is None:\n                    raise ValueError(\n                        f\"Document {doc.id!r} has no embedding. \"\n                        \"TurboQuantDocumentStore only stores documents with precomputed \"\n                        \"embeddings — run an embedder component before writing.\"\n                    )\n                self._commit_batch([doc])\n                written += 1\n            return written\n\n        # SKIP / OVERWRITE: first pass validates and resolves duplicates\n        # against the batch-so-far as well as the existing store:\n        # InMemoryDocumentStore writes into its dict as it iterates, so a\n        # repeated id *within a single call* is resolved the same way a\n        # cross-call repeat would be. Without tracking the batch, every\n        # duplicate row still gets its own vector while _str_to_u64 keeps\n        # only the last handle, orphaning the earlier vectors.\n        to_write: List[Document] = []\n        batch_pos: Dict[str, int] = {}  # doc.id -> index into to_write\n        to_remove: List[str] = []  # existing ids to drop, deferred past add","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/haystack.py#L248-L284","documentation":"Raised in _write_documents_locked when a Document has embedding=None. TurboQuantDocumentStore stores only precomputed embeddings — there is no embedder inside the store — so writing an un-embedded document would create an unsearchable entry. It fires in both the FAIL path and the SKIP/OVERWRITE validation pass.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/haystack.py:266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run a haystack Embedder component (e.g. SentenceTransformersDocumentEmbedder) on the documents before write_documents.","Check the pipeline wiring: the embedder step may have been skipped or produced None for some documents.","Catch the ValueError in ingestion code to identify which document ids lack embeddings."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}