{"record":{"id":"9f052bf9c56cdfbb","repo":"RyanCodrai/turbovec","slug":"invalid-filter-syntax-see-https-docs-haystack-d","errorCode":null,"errorMessage":"Invalid filter syntax. See https://docs.haystack.deepset.ai/docs/metadata-filtering for details.","messagePattern":"Invalid filter syntax\\. See https://docs\\.haystack\\.deepset\\.ai/docs/metadata-filtering for details\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/haystack.py","lineNumber":572,"sourceCode":"                for data in docs_data\n                if key in data[\"meta\"] and data[\"meta\"][key] is not None\n            },\n            key=str,\n        )\n        return values, len(values)\n\n    @staticmethod\n    def _validate_filters(filters: Optional[Dict[str, Any]]) -> None:\n        # Match InMemoryDocumentStore (document_store.py:504-509): a\n        # filter dict must have a top-level \"operator\" (simple comparison\n        # or logical) or \"conditions\" (compound). A bare \"field\" without\n        # an operator is malformed and the reference rejects it; we do too.\n        if (\n            filters\n            and \"operator\" not in filters\n            and \"conditions\" not in filters\n        ):\n            raise ValueError(\n                \"Invalid filter syntax. See https://docs.haystack.deepset.ai/docs/metadata-filtering for details.\"\n            )\n\n    # ---- Retrieval (not in core protocol but expected) ----------------\n\n    def embedding_retrieval(\n        self,\n        query_embedding: List[float],\n        filters: Optional[Dict[str, Any]] = None,\n        top_k: int = 10,\n        scale_score: bool = False,\n        return_embedding: Optional[bool] = None,\n    ) -> List[Document]:\n        \"\"\"Return the ``top_k`` documents most similar to ``query_embedding``.\n\n        ``return_embedding=None`` (default) honours the store-level\n        ``return_embedding`` set in the constructor. turbovec never has\n        the full-precision embedding either way — the parameter is here","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/haystack.py#L554-L590","documentation":"Raised by the static _validate_filters helper when a filter dict has neither a top-level 'operator' nor 'conditions' key — e.g. a bare {'field': 'value'} without an operator. It matches InMemoryDocumentStore's rejection of malformed Haystack filter syntax and is called by every filter-consuming method.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/haystack.py:572 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use Haystack filter syntax: {'operator': 'AND'/'OR', 'conditions': [...]} or a simple {'field': {'operator': '==', 'value': ...}}.","Consult the linked Haystack metadata-filtering docs for the accepted shapes.","Catch the ValueError in retrieval code to report malformed filters to pipeline authors."],"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"}