{"record":{"id":"2f4e64a727640a38","repo":"quickwit-oss/quickwit","slug":"concatenate-field-uses-an-unknown-field-sub-fiel","errorCode":null,"errorMessage":"concatenate field uses an unknown field `{sub_field}`","messagePattern":"concatenate field uses an unknown field `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-doc-mapper/src/doc_mapper/mapping_tree.rs","lineNumber":1056,"sourceCode":"        }\n    }\n    for concatenate_field_entry in concatenate_fields {\n        let FieldMappingType::Concatenate(options) = &concatenate_field_entry.mapping_type else {\n            // we only pushed Concatenate fields in `concatenate_fields`\n            unreachable!();\n        };\n        let name = &concatenate_field_entry.name;\n        if mapping_node.branches.contains_key(name) {\n            bail!(\"duplicated field definition `{}`\", name);\n        }\n        let text_options: JsonObjectOptions = options.clone().into();\n        let field = schema.add_json_field(name, text_options);\n        for sub_field in &options.concatenate_fields {\n            for matched_field in\n                mapping_node\n                    .find_field_mapping_leaf(sub_field)\n                    .ok_or_else(|| {\n                        anyhow::anyhow!(\"concatenate field uses an unknown field `{sub_field}`\")\n                    })?\n            {\n                if !matched_field.typ.supported_for_concat() {\n                    bail!(\n                        \"subfield `{}` not supported inside a concatenate field\",\n                        sub_field\n                    );\n                }\n                matched_field.concatenate.push(field);\n            }\n        }\n        if options.include_dynamic_fields {\n            concatenate_dynamic_fields.push(field);\n        }\n    }\n    Ok(MappingNodeRoot {\n        field_mappings: mapping_node,\n        concatenate_dynamic_fields,","sourceCodeStart":1038,"sourceCodeEnd":1074,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-doc-mapper/src/doc_mapper/mapping_tree.rs#L1038-L1074","documentation":"A `concatenate` (concatenate_fields) mapping option references a sub-field by path, and the mapping tree must resolve that path to at least one existing field mapping leaf. When `find_field_mapping_leaf` returns nothing for the referenced path, building the mapping tree fails with this message naming the unknown sub-field.","triggerScenarios":"Declaring a concatenate field whose `concatenate_fields` list names a path that is not present in the index mapping (typo, renamed field, nested path written incorrectly), encountered during `build_mapping_tree_from_entries` when the schema/mapping is built.","commonSituations":"Renaming or deleting a field in the mapping while forgetting to update the concatenate field's reference list, typos in dotted nested paths, or referencing a field defined only in a different mapping version.","solutions":["Ensure every path listed in `concatenate_fields` exists in the index mapping with exactly the same name.","Fix typos or incorrect nesting in the dotted field path.","If the field was removed intentionally, delete its entry from the concatenate field's `concatenate_fields` list.","Only concatenate fields whose types are supported (`supported_for_concat`) to avoid the related 'not supported' error."],"exampleFix":"# before\nconcatenate_fields: [message, body_txt]\n# after\nconcatenate_fields: [message, body_text]","handlingStrategy":"validation","validationCode":"const concat_fields = [\"message\", \"body_text\"];\nconst mapped = new Set(Object.keys(indexConfig.docMapping.fieldEntries));\nconst missing = concat_fields.filter(f => !mapped.has(f));\nif (missing.length) throw new Error(`concatenate_fields unknown: ${missing}`);","typeGuard":null,"tryCatchPattern":"try {\n    createIndex(cfg);\n} catch (e) {\n    if (String(e).includes(\"concatenate field uses an unknown field\")) {\n        // reconcile concatenate_fields with actual mapping\n    }\n}","preventionTips":["Keep concatenate_fields lists in sync when renaming/removing fields.","Generate the list from the mapping definition instead of hardcoding.","Verify nested dotted paths match mapping structure exactly."],"tags":["mapping","schema","config","validation"],"backgroundTag":"resource-not-found","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}