{"record":{"id":"e54a79b264996ed5","repo":"deepset-ai/haystack","slug":"unknown-join-mode-string-supported-modes-in-d","errorCode":null,"errorMessage":"Unknown join mode '{string}'. Supported modes in DocumentJoiner are: {list(enum_map.keys())}","messagePattern":"Unknown join mode '(.+?)'\\. Supported modes in DocumentJoiner are: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/components/joiners/document_joiner.py","lineNumber":41,"sourceCode":"\n    CONCATENATE = \"concatenate\"\n    MERGE = \"merge\"\n    RECIPROCAL_RANK_FUSION = \"reciprocal_rank_fusion\"\n    DISTRIBUTION_BASED_RANK_FUSION = \"distribution_based_rank_fusion\"\n\n    def __str__(self) -> str:\n        return self.value\n\n    @staticmethod\n    def from_str(string: str) -> \"JoinMode\":\n        \"\"\"\n        Convert a string to a JoinMode enum.\n        \"\"\"\n        enum_map = {e.value: e for e in JoinMode}\n        mode = enum_map.get(string)\n        if mode is None:\n            msg = f\"Unknown join mode '{string}'. Supported modes in DocumentJoiner are: {list(enum_map.keys())}\"\n            raise ValueError(msg)\n        return mode\n\n\n@component\nclass DocumentJoiner:\n    \"\"\"\n    Joins multiple lists of documents into a single list.\n\n    It supports different join modes:\n    - concatenate: Keeps the highest-scored document in case of duplicates.\n    - merge: Calculates a weighted sum of scores for duplicates and merges them.\n    - reciprocal_rank_fusion: Merges and assigns scores based on reciprocal rank fusion.\n    - distribution_based_rank_fusion: Merges and assigns scores based on scores distribution in each Retriever.\n\n    ### Usage example:\n\n    ```python\n    from haystack import Pipeline, Document","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/joiners/document_joiner.py#L23-L59","documentation":"JoinMode.from_str converts a string join mode into the JoinMode enum used by DocumentJoiner. It raises ValueError when the string does not match any enum value ('concatenate', 'merge', 'reciprocal_rank_fusion', 'split_documents').","triggerScenarios":"Passing DocumentJoiner(join_mode='rrf'), join_mode='CONCATENATE' (uppercase), or any misspelled/unsupported mode string to the constructor or anywhere JoinMode.from_str is called.","commonSituations":"Typos or shorthand ('rrf' instead of 'reciprocal_rank_fusion'); wrong casing; copying a mode name from a different library; version drift where a mode was added/renamed.","solutions":["Use one of the exact enum values: print([e.value for e in JoinMode]) to list them.","Import the enum and pass it directly: from haystack.components.joiners import JoinMode; DocumentJoiner(join_mode=JoinMode.RECIPROCAL_RANK_FUSION).","Fix casing/typos to match the lowercase enum value exactly."],"exampleFix":"// before\nDocumentJoiner(join_mode=\"rrf\")\n// after\nfrom haystack.components.joiners import JoinMode\nDocumentJoiner(join_mode=JoinMode.RECIPROCAL_RANK_FUSION)  # or \"reciprocal_rank_fusion\"","handlingStrategy":"validation","validationCode":"from haystack.components.joiners.document_joiner import JoinMode\nVALID = {e.value for e in JoinMode}\nassert mode in VALID, f\"join_mode must be one of {sorted(VALID)}, got {mode!r}\"","typeGuard":"def is_join_mode(s: str) -> bool:\n    return s in {e.value for e in JoinMode}","tryCatchPattern":"try:\n    joiner = DocumentJoiner(join_mode=mode)\nexcept ValueError as e:\n    logger.error(\"bad join_mode %r: %s\", mode, e)\n    joiner = DocumentJoiner(join_mode=JoinMode.CONCATENATE)","preventionTips":["Pass the JoinMode enum member instead of a raw string","Copy the exact lowercase value ('reciprocal_rank_fusion', not 'rrf')","Check the error message: it lists all supported modes"],"tags":["validation","enum","haystack"],"backgroundTag":"invalid-enum-value","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}