{"record":{"id":"67f66fbd605cb056","repo":"chroma-core/chroma","slug":"search-is-not-implemented-for-segmentapi","errorCode":null,"errorMessage":"Search is not implemented for SegmentAPI","messagePattern":"Search is not implemented for SegmentAPI","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"chromadb/api/segment.py","lineNumber":484,"sourceCode":"    @override\n    def _get_indexing_status(\n        self,\n        collection_id: UUID,\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n    ) -> \"IndexingStatus\":\n        raise NotImplementedError(\"Indexing status is not implemented for SegmentAPI\")\n\n    @override\n    def _search(\n        self,\n        collection_id: UUID,\n        searches: List[Search],\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n        read_level: ReadLevel = ReadLevel.INDEX_AND_WAL,\n    ) -> SearchResult:\n        raise NotImplementedError(\"Search is not implemented for SegmentAPI\")\n\n    @trace_method(\"SegmentAPI.delete_collection\", OpenTelemetryGranularity.OPERATION)\n    @override\n    @rate_limit\n    def delete_collection(\n        self,\n        name: str,\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n    ) -> None:\n        existing = self._sysdb.get_collections(\n            name=name, tenant=tenant, database=database\n        )\n\n        if existing:\n            self._manager.delete_segments(existing[0].id)\n            self._sysdb.delete_collection(\n                existing[0].id, tenant=tenant, database=database","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/segment.py#L466-L502","documentation":"The multi-vector Search API (collection.search(...) with typed Search objects, per-search queries/filters and read levels) is declared on the shared API contract but is not implemented by the embedded SegmentAPI backend: _search raises NotImplementedError unconditionally. Embedded clients still support the classic collection.query(...) path, which is served by a different code path (the executor plan over the local segments).","triggerScenarios":"Calling collection.search(...) (which delegates to client._search(collection_id, searches, ...)) on an embedded client — chromadb.Client(), EphemeralClient, PersistentClient — or calling the internal _search directly.","commonSituations":"Adopting the newer search() API in code that must also run embedded in tests or notebooks; copy-pasting server-oriented example code; abstraction layers that pick between query() and search() without also switching the backend.","solutions":["Use collection.query(query_embeddings=..., n_results=...) instead of search() when running embedded","Point the code at a Chroma server via chromadb.HttpClient, where search() is implemented","Add a capability branch: try/except NotImplementedError (or check chroma_api_impl) that falls back to query()"],"exampleFix":"// before\nres = coll.search(queries=[...])  # NotImplementedError on PersistentClient\n\n// after\nres = coll.query(query_embeddings=[emb], n_results=10)","handlingStrategy":"fallback","validationCode":"import chromadb\n\ndef supports_search(client: chromadb.ClientAPI) -> bool:\n    impl = client.get_settings().chroma_api_impl\n    return impl not in ('chromadb.api.segment.SegmentAPI', 'chromadb.api.rust.RustBindingsAPI')","typeGuard":null,"tryCatchPattern":"try:\n    res = coll.search(queries=queries)\nexcept NotImplementedError:\n    res = coll.query(query_embeddings=[q.query_embedding for q in queries], n_results=k)","preventionTips":["Prefer collection.query() for code that must run both embedded and against a server","Hide search()/query() behind one repository method so the backend switch is a single place","Document which endpoints of your app require the server backend"],"tags":["chroma","segment-api","embedded","not-implemented","vector-search"],"backgroundTag":"operation-not-supported-by-backend","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}