quickwit-oss/quickwit · error

range query with multiple fields is not supported

Error message

range query with multiple fields is not supported

What it means

Same inference path as the no-field case: a field-less range leaf must pick a single field from default_search_fields. If more than one default search field is configured, the target is ambiguous, and Quickwit refuses to guess, bailing with this error.

Solutions

  1. Qualify the range with an explicit field name in the query string.
  2. Reduce the request's default search fields to one when unfielded ranges are used.
  3. Use the structured range_query DSL (which requires a field) instead of the shorthand syntax.

Example fix

// before
parse_user_query_with_default_fields("[1 TO 10]", &["title", "body"])
// after
parse_user_query_with_default_fields("title:[1 TO 10]", &["title", "body"])
Defensive patterns

Strategy: validation

Validate before calling

if !query_str.contains(':') && query_str.contains(" TO ") && default_search_fields.len() > 1 {
    return Err("unfielded range query ambiguous with multiple default fields; qualify the field");
}

Try / catch

match parse_user_query(q) {
    Err(e) if e.to_string().contains("range query with multiple fields") => {
        // retry with an explicit field prefix
    }
    r => r?,
}

Prevention

When it happens

Trigger: Parsing an unfielded range query string while default_search_fields contains 2+ entries, e.g. `parse_user_query("[1 TO 10]")` with defaults ["title", "body"].

Common situations: Indexes or search requests configured with multiple default search fields while users issue shorthand range queries; migration from single-default-field setups to multi-field defaults breaking old query strings.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at quickwit/quickwit-query/src/query_ast/user_input_query.rs:140

        }
        UserInputAst::Leaf(leaf) => match *leaf {
            UserInputLeaf::Literal(literal) => {
                convert_user_input_literal(literal, default_search_fields, lenient)
            }
            UserInputLeaf::All => Ok(QueryAst::MatchAll),
            UserInputLeaf::Range {
                field,
                lower,
                upper,
            } => {
                let field = if let Some(field) = field {
                    field
                } else if default_search_fields.len() == 1 {
                    default_search_fields[0].clone()
                } else if default_search_fields.is_empty() {
                    bail!("range query without field is not supported");
                } else {
                    bail!("range query with multiple fields is not supported");
                };
                let convert_bound = |user_input_bound: UserInputBound| match user_input_bound {
                    UserInputBound::Inclusive(user_text) => {
                        Bound::Included(JsonLiteral::String(user_text))
                    }
                    UserInputBound::Exclusive(user_text) => {
                        Bound::Excluded(JsonLiteral::String(user_text))
                    }
                    UserInputBound::Unbounded => Bound::Unbounded,
                };
                let range_query = query_ast::RangeQuery {
                    field,
                    lower_bound: convert_bound(lower),
                    upper_bound: convert_bound(upper),
                };
                Ok(range_query.into())
            }
            UserInputLeaf::Set { field, elements } => {

View on GitHub (pinned to a39730c5cd)