{"record":{"id":"97d3e6c32e707ad2","repo":"quickwit-oss/tantivy","slug":"ip-address-support-in-dynamic-fields-is-not-yet-im-97d3e6","errorCode":null,"errorMessage":"IP address support in dynamic fields is not yet implemented","messagePattern":"IP address support in dynamic fields is not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/fastfield/writer.rs","lineNumber":346,"sourceCode":"                    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,\n                    remaining_depth_limit,\n                    json_path_writer,\n                    columnar_writer,","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/quickwit-oss/tantivy/blob/b5d8deb80c26924e6b007a5b1a7630f35ca64de4/src/fastfield/writer.rs#L328-L364","documentation":"This panic is raised by record_json_value_to_columnar_writer when a JSON dynamic field value is an IpAddr leaf. Tantivy's columnar (fast field) writer does not yet support IP address values inside dynamic/JSON fields, so the code path is explicitly marked unimplemented. It is a library feature gap, not a user bug.","triggerScenarios":"Calling add_json_object / add_named_doc (or IndexWriter APIs that funnel into record_json_value_to_columnar_writer) with a JSON field whose value is an IpAddr ReferenceValue leaf, e.g. ip: \"192.168.0.1\" typed as IpAddr in a dynamic field.","commonSituations":"Indexing documents containing IP addresses as part of a JSON/dynamic field; migrating a schema from dedicated IP fields to catch-all JSON fields; JSON logs ingestion with ip attributes.","solutions":["Move IP values out of JSON dynamic fields into a dedicated typed field with field type Ip (schema-level ip fast field).","Store the IP as a string inside the JSON field if only display is needed (not as IpAddr leaf).","Pre-process documents to strip or convert ip fields before indexing.","Track upstream tantivy support for IpAddr in JSON dynamic fields and upgrade."],"exampleFix":"// before\njson_field_raw.add_json_object(doc, json!({\"client_ip\": \"10.0.0.1\"})); // IpAddr leaf -> panic\n// after\nlet mut schema_builder = Schema::builder();\nschema_builder.add_ip_field(\"client_ip\", INDEXED | STORED | FAST);\nlet doc = Schema::builder().build().into();\n// index client_ip via the dedicated ip field, not inside the JSON object","handlingStrategy":"validation","validationCode":"fn json_has_ip_values(obj: &serde_json::Value) -> bool {\n    match obj {\n        serde_json::Value::String(s) => s.parse::<std::net::IpAddr>().is_ok(),\n        serde_json::Value::Object(m) => m.values().any(json_has_ip_values),\n        serde_json::Value::Array(a) => a.iter().any(json_has_ip_values),\n        _ => false,\n    }\n}","typeGuard":"fn is_ip_leaf(v: &ReferenceValueLeaf) -> bool {\n    matches!(v, ReferenceValueLeaf::IpAddr(_))\n}","tryCatchPattern":null,"preventionTips":["Keep IP data in dedicated schema ip fields, never inside JSON dynamic fields.","Validate JSON documents against an allowlist of leaf types before add_json_object.","Write an ingestion test that round-trips your JSON shapes through the columnar writer.","Track tantivy release notes for IpAddr-in-JSON support before upgrading assumptions."],"tags":["unimplemented","fastfield","json","ip-address"],"backgroundTag":"unimplemented-fastfield-json-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"}