{"record":{"id":"27966a32efd10606","repo":"deepset-ai/haystack","slug":"unsupported-document-comparison-field-self-docu-27966a","errorCode":null,"errorMessage":"Unsupported document_comparison_field: '{self.document_comparison_field}'. Use 'content', 'id', or 'meta.<key>'.","messagePattern":"Unsupported document_comparison_field: '(.+?)'\\. Use 'content', 'id', or 'meta\\.<key>'\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"haystack/components/evaluators/document_mrr.py","lineNumber":78,"sourceCode":"        Extract the comparison value from a document based on the configured field.\n        \"\"\"\n        if self.document_comparison_field == \"content\":\n            return doc.content\n        if self.document_comparison_field == \"id\":\n            return doc.id\n        if self.document_comparison_field.startswith(\"meta.\"):\n            parts = self.document_comparison_field[5:].split(\".\")\n            value = doc.meta\n            for part in parts:\n                if not isinstance(value, dict) or part not in value:\n                    return None\n                value = value[part]\n            return value\n        msg = (\n            f\"Unsupported document_comparison_field: '{self.document_comparison_field}'. \"\n            \"Use 'content', 'id', or 'meta.<key>'.\"\n        )\n        raise ValueError(msg)\n\n    def to_dict(self) -> dict[str, Any]:\n        \"\"\"\n        Serializes the component to a dictionary.\n\n        :returns:\n            Dictionary with serialized data.\n        \"\"\"\n        return default_to_dict(self, document_comparison_field=self.document_comparison_field)\n\n    # Refer to https://www.pinecone.io/learn/offline-evaluation/ for the algorithm.\n    @component.output_types(score=float, individual_scores=list[float])\n    def run(\n        self, ground_truth_documents: list[list[Document]], retrieved_documents: list[list[Document]]\n    ) -> dict[str, Any]:\n        \"\"\"\n        Run the DocumentMRREvaluator on the given inputs.\n","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/evaluators/document_mrr.py#L60-L96","documentation":"DocumentMRREvaluator._get_comparison_value resolves each Document's comparison value from document_comparison_field and raises ValueError when the configured field is not 'content', 'id', or 'meta.<key>'. Like the MAP evaluator, an invalid field spec only fails at run() time when documents are compared.","triggerScenarios":"Constructing `DocumentMRREvaluator(document_comparison_field=\"contents\")`, 'meta' without a key, or any unsupported string; the error is raised from run() via _get_comparison_value.","commonSituations":"Typos in pipeline YAML; forgetting the 'meta.' prefix for a meta key; assuming custom field names like 'blob' are supported.","solutions":["Use exactly 'content', 'id', or 'meta.<key>' for document_comparison_field","For meta values, write the full path e.g. `document_comparison_field=\"meta.source.url\"`","Check the value stored after from_dict/from_yaml round-trips"],"exampleFix":"// before\nDocumentMRREvaluator(document_comparison_field=\"Meta.title\")\n// after\nDocumentMRREvaluator(document_comparison_field=\"meta.title\")","handlingStrategy":"validation","validationCode":"if not (document_comparison_field in (\"content\", \"id\") or document_comparison_field.startswith(\"meta.\")):\n    raise ValueError(\"field must be 'content', 'id', or 'meta.<key>'\")","typeGuard":"def is_valid_comparison_field(field: object) -> bool:\n    return isinstance(field, str) and (field in (\"content\", \"id\") or field.startswith(\"meta.\"))","tryCatchPattern":"try:\n    result = evaluator.run(ground_truth_documents=gt, retrieved_documents=ret)\nexcept ValueError as e:\n    if \"Unsupported document_comparison_field\" in str(e):\n        evaluator.document_comparison_field = \"content\"\n        result = evaluator.run(ground_truth_documents=gt, retrieved_documents=ret)\n    else:\n        raise","preventionTips":["Use exactly one of 'content', 'id', 'meta.<key>'","Prefix meta keys with 'meta.'","Avoid trailing whitespace in YAML values","Unit-test evaluator construction with your production config"],"tags":["python","value-error","evaluators","configuration"],"backgroundTag":"invalid-config-option","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}