{"record":{"id":"8c77f7065b62f109","repo":"quickwit-oss/quickwit","slug":"timestamp-field-timestamp-field-path-should-no","errorCode":null,"errorMessage":"timestamp field `{timestamp_field_path}` should not start with a `.`","messagePattern":"timestamp field `(.+?)` should not start with a `\\.`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-doc-mapper/src/doc_mapper/doc_mapper_impl.rs","lineNumber":106,"sourceCode":"    /// The partition key is a DSL used to route documents\n    /// into specific splits.\n    partition_key: RoutingExpr,\n    /// Maximum number of partitions\n    max_num_partitions: NonZeroU32,\n    /// Defines how unmapped fields should be handle.\n    mode: Mode,\n    /// User-defined tokenizers.\n    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\");","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-doc-mapper/src/doc_mapper/doc_mapper_impl.rs#L88-L124","documentation":"When building a DocMapper from its config, `validate_timestamp_field` checks the configured `timestamp_field` path. A path beginning with `.` (or the escaped form `\\.`) is structurally invalid for a field path, so the builder rejects it before any indexing happens.","triggerScenarios":"Calling `DocMapperBuilder::try_from` (index creation or config validation) with `doc_mapping.timestamp_field` set to a value like `.timestamp` or `\\.timestamp`.","commonSituations":"Hand-written index configs where the user typed a leading dot thinking it meant root; generated configs joining path segments with separators; YAML mistakes adding a stray dot.","solutions":["Remove the leading `.` (and any leading `\\.`) from `timestamp_field` in the index config.","Express the field as a plain dotted path from the mapping root, e.g. `timestamp_field: \"timestamp\"` or `\"event.time\"`.","Re-run index config validation after the fix."],"exampleFix":"// before (index config YAML)\ndoc_mapping:\n  timestamp_field: \".timestamp\"\n// after\ndoc_mapping:\n  timestamp_field: \"timestamp\"","handlingStrategy":"validation","validationCode":"const ts = config.doc_mapping.timestamp_field;\nif (typeof ts === 'string' && (ts.startsWith('.') || ts.startsWith('\\\\.'))) {\n  throw new Error(`timestamp_field \"${ts}\" must not start with a dot`);\n}","typeGuard":"fn is_valid_leading_path(p: &str) -> bool { !p.starts_with('.') && !p.starts_with(\"\\\\.\") }","tryCatchPattern":"match DocMapperBuilder::try_from(config) {\n    Ok(dm) => Ok(dm),\n    Err(e) if e.to_string().contains(\"should not start with\") => Err(ConfigError::InvalidTimestampField(e.to_string())),\n    Err(e) => Err(e.into()),\n}","preventionTips":["Write timestamp_field as a plain dotted path from the mapping root.","Lint index configs for leading/trailing dots in field paths.","Generate field paths with a joiner that never adds leading separators."],"tags":["doc-mapping","config-validation","timestamp","field-path"],"backgroundTag":"invalid-config-value","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"}