{"record":{"id":"72f33e60660f9eca","repo":"quickwit-oss/quickwit","slug":"tags-collection-is-not-allowed-on-bytes-fields","errorCode":null,"errorMessage":"tags collection is not allowed on `bytes` fields","messagePattern":"tags collection is not allowed on `bytes` fields","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-indexing/src/actors/packager.rs","lineNumber":253,"sourceCode":"    for inv_index in inv_indexes {\n        let mut terms_streamer = inv_index.terms().stream()?;\n        while let Some((term_data, _)) = terms_streamer.next() {\n            let term = match named_field.field_type {\n                FieldType::U64(_) => u64_from_term_data(term_data)?.to_string(),\n                FieldType::I64(_) => {\n                    tantivy::u64_to_i64(u64_from_term_data(term_data)?).to_string()\n                }\n                FieldType::F64(_) => {\n                    tantivy::u64_to_f64(u64_from_term_data(term_data)?).to_string()\n                }\n                FieldType::Bool(_) => match u64_from_term_data(term_data)? {\n                    0 => false,\n                    1 => true,\n                    _ => bail!(\"invalid boolean value\"),\n                }\n                .to_string(),\n                FieldType::Bytes(_) => {\n                    bail!(\"tags collection is not allowed on `bytes` fields\")\n                }\n                _ => std::str::from_utf8(term_data)?.to_string(),\n            };\n            terms.push(term);\n        }\n    }\n    Ok(terms)\n}\n\nfn create_packaged_split(\n    index_meta: &IndexMeta,\n    split: IndexedSplit,\n    tag_fields: &[NamedField],\n    ctx: &ActorContext<Packager>,\n) -> anyhow::Result<PackagedSplit> {\n    debug!(split_id = %split.split_id(), \"create-packaged-split\");\n    let split_files = list_split_files(index_meta, &split.split_scratch_directory)?;\n","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-indexing/src/actors/packager.rs#L235-L271","documentation":"Tag collection (tag_fields-based term extraction) is only supported for fields whose values can be rendered as string tags. `bytes` fields are explicitly disallowed because binary values do not make usable tags, so `try_extract_terms` refuses them.","triggerScenarios":"Packaging a split where a `tag_fields`-listed field has schema type `bytes` during `create_packaged_split`.","commonSituations":"Misconfigured `tag_fields` that includes a bytes field (e.g. a raw payload or binary id); schema type changed to bytes after tag fields were configured.","solutions":["Remove the bytes field from `tag_fields` in the index config.","If the bytes field actually holds text, change its schema type to a string type.","Add a separate string field (e.g. hex/base64 encoding) for tagging instead of tagging the raw bytes."],"exampleFix":"// before (index config)\ntag_fields: [\"raw_payload\"]  // raw_payload: bytes\n// after\ntag_fields: [\"service\"]","handlingStrategy":"validation","validationCode":"// validate tag_fields against the schema before applying an index config\nfn validate_tag_fields(schema: &Schema, tag_fields: &[String]) -> Result<(), String> {\n    for f in tag_fields {\n        if matches!(schema.get_field(f).unwrap().field_type(), FieldType::Bytes(_)) {\n            return Err(format!(\"tag field '{}' cannot be bytes\", f));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-check tag_fields against the doc mapping schema at config-load time.","Exclude bytes/binary fields from tag_fields; tag a derived string field instead.","Update tag_fields whenever a field's type changes to bytes."],"tags":["packaging","tags","config","field-type"],"backgroundTag":"unsupported-operation","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"}