{"record":{"id":"548dcf669429014d","repo":"quickwit-oss/quickwit","slug":"could-not-find-timestamp-field-timestamp-field-p","errorCode":null,"errorMessage":"could not find timestamp field `{timestamp_field_path}` in field mappings","messagePattern":"could not find timestamp field `(.+?)` in field mappings","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-doc-mapper/src/doc_mapper/doc_mapper_impl.rs","lineNumber":114,"sourceCode":"    tokenizer_entries: Vec<TokenizerEntry>,\n    /// Tokenizer manager.\n    tokenizer_manager: TokenizerManager,\n}\n\nfn validate_timestamp_field(\n    timestamp_field_path: &str,\n    mapping_root_node: &MappingNode,\n) -> anyhow::Result<()> {\n    if timestamp_field_path.starts_with('.') || timestamp_field_path.starts_with(\"\\\\.\") {\n        bail!(\"timestamp field `{timestamp_field_path}` should not start with a `.`\");\n    }\n    if timestamp_field_path.ends_with('.') {\n        bail!(\"timestamp field `{timestamp_field_path}` should not end with a `.`\");\n    }\n    let Some(timestamp_field_type) =\n        mapping_root_node.find_field_mapping_type(timestamp_field_path)\n    else {\n        bail!(\"could not find timestamp field `{timestamp_field_path}` in field mappings\");\n    };\n    if let FieldMappingType::DateTime(date_time_option, cardinality) = &timestamp_field_type {\n        if cardinality != &Cardinality::SingleValued {\n            bail!(\"timestamp field `{timestamp_field_path}` should be single-valued\");\n        }\n        if !date_time_option.fast {\n            bail!(\"timestamp field `{timestamp_field_path}` should be a fast field\");\n        }\n    } else {\n        bail!(\"timestamp field `{timestamp_field_path}` should be a datetime field\");\n    }\n    Ok(())\n}\n\nimpl From<DocMapper> for DocMapperBuilder {\n    fn from(default_doc_mapper: DocMapper) -> Self {\n        let partition_key_str = default_doc_mapper.partition_key.to_string();\n        let partition_key_opt: Option<String> = if !partition_key_str.is_empty() {","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-doc-mapper/src/doc_mapper/doc_mapper_impl.rs#L96-L132","documentation":"After format checks, `validate_timestamp_field` looks up `timestamp_field` in the mapping tree via `find_field_mapping_type`. If no field matches the path, the DocMapper builder bails: a timestamp field must point at an existing mapped field.","triggerScenarios":"Calling `DocMapperBuilder::try_from` where `doc_mapping.timestamp_field` names a path absent from `field_mappings` — misspelled name, wrong nesting level, or the field was removed from the mapping while still referenced as timestamp field.","commonSituations":"Renaming or deleting a field in the doc mapping but forgetting to update `timestamp_field`; typos; pointing at a dynamic/virtual field that is not declared in field_mappings; changing object nesting so the dotted path no longer resolves.","solutions":["Make `timestamp_field` exactly match an existing field path in `doc_mapping.field_mappings` (check spelling and nesting, e.g. `event.time`).","Add the field to the mapping if it is genuinely missing.","Remove or update `timestamp_field` when the underlying field was deleted."],"exampleFix":"// before\ndoc_mapping:\n  field_mappings:\n    - name: ts\n      type: datetime\n  timestamp_field: \"timestamp\"\n// after\ndoc_mapping:\n  field_mappings:\n    - name: ts\n      type: datetime\n  timestamp_field: \"ts\"","handlingStrategy":"validation","validationCode":"function fieldExists(mapping, path) {\n  const parts = path.split('.');\n  let node = mapping.field_mappings;\n  for (const p of parts) {\n    const hit = (Array.isArray(node) ? node : []).find(f => f.name === p);\n    if (!hit) return false;\n    node = hit.field_mappings ?? [];\n  }\n  return true;\n}\n// before applying config: if (!fieldExists(cfg.doc_mapping, cfg.doc_mapping.timestamp_field)) throw ...","typeGuard":null,"tryCatchPattern":"match DocMapperBuilder::try_from(config) {\n    Ok(dm) => Ok(dm),\n    Err(e) if e.to_string().contains(\"could not find timestamp field\") => Err(ConfigError::UnknownTimestampField(e.to_string())),\n    Err(e) => Err(e.into()),\n}","preventionTips":["Keep timestamp_field in sync whenever you rename or delete mapped fields.","Only reference fields explicitly declared in field_mappings.","Validate the full index config (create-index dry run) before applying."],"tags":["doc-mapping","config-validation","timestamp","field-not-found"],"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"}