quickwit-oss/quickwit · error

fast field is not allowed for array<bytes>

Error message

fast field is not allowed for array<bytes>

What it means

Bytes fields can be configured as fast columns for scalar (single-valued) fields, but a fast bytes column is not allowed for arrays (cardinality MultiValued). The deserializer rejects `type: array<bytes>` with `fast: true` to avoid an unsupported fast-field layout.

Source

Thrown at quickwit/quickwit-doc-mapper/src/doc_mapper/field_mapping_entry.rs:779

        }
        Type::Bool => {
            let bool_options: QuickwitBoolOptions = serde_json::from_value(json)?;
            Ok(FieldMappingType::Bool(bool_options, cardinality))
        }
        Type::IpAddr => {
            let ip_addr_options: QuickwitIpAddrOptions = serde_json::from_value(json)?;
            Ok(FieldMappingType::IpAddr(ip_addr_options, cardinality))
        }
        Type::Date => {
            let date_time_options = serde_json::from_value::<QuickwitDateTimeOptions>(json)?;
            Ok(FieldMappingType::DateTime(date_time_options, cardinality))
        }
        Type::Facet => unimplemented!("Facet are not supported in quickwit yet."),
        Type::Custom => bail!("custom fields are not supported in Quickwit"),
        Type::Bytes => {
            let numeric_options: QuickwitBytesOptions = serde_json::from_value(json)?;
            if numeric_options.fast && cardinality == Cardinality::MultiValued {
                bail!("fast field is not allowed for array<bytes>");
            }
            Ok(FieldMappingType::Bytes(numeric_options, cardinality))
        }
        Type::Json => {
            let json_options: QuickwitJsonOptions = serde_json::from_value(json)?;
            Ok(FieldMappingType::Json(json_options, cardinality))
        }
    }
}

impl TryFrom<FieldMappingEntryForSerialization> for FieldMappingEntry {
    type Error = String;

    fn try_from(value: FieldMappingEntryForSerialization) -> Result<Self, String> {
        validate_field_mapping_name(&value.name).map_err(|err| err.to_string())?;
        let quickwit_field_type =
            QuickwitFieldType::parse_type_id(&value.type_id).ok_or_else(|| {
                format!(

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Set `fast: false` for the array<bytes> field, or drop the `fast` key.
  2. Change the field to single-valued `bytes` if you truly need a fast bytes column.
  3. If you need fast access to multiple byte values, store them as separate fields or use a json field instead.

Example fix

// before
{name: "payload", type: "array<bytes>", fast: true}
// after
{name: "payload", type: "array<bytes>"}
Defensive patterns

Strategy: validation

Validate before calling

fn bytes_fast_allowed(f: &serde_json::Value) -> bool {
    let is_array_bytes = f.get("type").and_then(|t| t.as_str()) == Some("array<bytes>");
    let fast = f.get("fast").and_then(|v| v.as_bool()) == Some(true);
    !(is_array_bytes && fast)
}

Try / catch

match create_index_result {
    Err(e) if e.to_string().contains("fast field is not allowed for array<bytes>") => {
        eprintln!("Disable fast on array<bytes> fields");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Field mapping `{name: "blob", type: "array<bytes>", fast: true}` — the Bytes arm of from_json bails when fast is set on a multivalued bytes field.

Common situations: Users enabling `fast` on byte-array fields expecting aggregation/filtering on byte arrays; templates that set fast:true on all fields regardless of type/cardinality.

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/50bb614109a2c88e. Report an issue: GitHub.