{"record":{"id":"c5891d0fefb32087","repo":"quickwit-oss/tantivy","slug":"bytes-support-in-dynamic-fields-is-not-yet-impleme-c5891d","errorCode":null,"errorMessage":"Bytes support in dynamic fields is not yet implemented","messagePattern":"Bytes support in dynamic fields is not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/fastfield/writer.rs","lineNumber":343,"sourceCode":"                columnar_writer.record_numerical(\n                    doc,\n                    json_path_writer.as_str(),\n                    NumericalValue::from(val),\n                );\n            }\n            ReferenceValueLeaf::Bool(val) => {\n                columnar_writer.record_bool(doc, json_path_writer.as_str(), val);\n            }\n            ReferenceValueLeaf::Date(val) => {\n                columnar_writer.record_datetime(doc, json_path_writer.as_str(), val);\n            }\n            ReferenceValueLeaf::Facet(_) => {\n                unimplemented!(\"Facet support in dynamic fields is not yet implemented\")\n            }\n            ReferenceValueLeaf::Bytes(_) => {\n                // TODO: This can be re added once it is added to the JSON Utils section as well.\n                // columnar_writer.record_bytes(doc, json_path_writer.as_str(), val);\n                unimplemented!(\"Bytes support in dynamic fields is not yet implemented\")\n            }\n            ReferenceValueLeaf::IpAddr(_) => {\n                unimplemented!(\"IP address support in dynamic fields is not yet implemented\")\n            }\n            ReferenceValueLeaf::PreTokStr(_) => {\n                unimplemented!(\n                    \"Pre-tokenized string support in dynamic fields is not yet implemented\"\n                )\n            }\n            ReferenceValueLeaf::Custom(_) => {\n                unimplemented!(\"the JSON field does not support custom field types\")\n            }\n        },\n        ReferenceValue::Array(elements) => {\n            for el in elements {\n                record_json_value_to_columnar_writer(\n                    doc,\n                    el,","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/quickwit-oss/tantivy/blob/b5d8deb80c26924e6b007a5b1a7630f35ca64de4/src/fastfield/writer.rs#L325-L361","documentation":"record_json_value_to_columnar_writer panics with unimplemented!() for Bytes leaves in dynamic JSON fields. The bytes recording call is commented out (TODO) pending support in the JSON utils path, so byte values cannot be turned into fast-field columns yet. Use schema-typed bytes fields instead.","triggerScenarios":"Writing a segment where a dynamic JSON field contains a Bytes leaf — via record_json_obj_to_columnar_writer or the recursive call during segment writing/test_columnar_from_jsons_aux.","commonSituations":"Storing binary data inside JSON fields; converting typed bytes fields to dynamic JSON fields.","solutions":["Declare a bytes field in the schema and store the value there","Encode bytes as base64 strings in the JSON field if only retrieval (not fast-field access) is needed","Remove byte values from dynamic JSON documents before indexing"],"exampleFix":"// before\njson_obj.insert(\"data\", Value::Bytes(bytes));\n// after\nlet data = schema_builder.add_bytes_field(\"data\", STORED); // typed field","handlingStrategy":"validation","validationCode":"fn json_has_bytes_leaves(v: &tantivy::schema::OwnedValue) -> bool {\n    matches!(v, tantivy::schema::OwnedValue::Bytes(_))\n}\n// screen dynamic JSON values before add_document","typeGuard":"fn is_bytes_leaf(v: &tantivy::schema::Value) -> bool {\n    matches!(v.as_value(), tantivy::schema::ReferenceValueLeaf::Bytes(_))\n}","tryCatchPattern":"let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| writer.commit()));\nif result.is_err() { eprintln!(\"segment write failed: bytes inside dynamic JSON fast fields\"); }","preventionTips":["Use schema-typed bytes fields for binary values","Base64-encode binary data kept inside JSON fields","Validate documents before add_document/commit","Watch tantivy changelogs for bytes-in-JSON fast-field support"],"tags":["rust","unimplemented","bytes","fast-fields","columnar"],"backgroundTag":"unimplemented-dynamic-field-type","analyzedSha":"b5d8deb80c26924e6b007a5b1a7630f35ca64de4","analyzedAt":"2026-09-05T13:20:51.521Z","contentChangedAt":"2026-09-05T13:20:51.521Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}