quickwit-oss/quickwit · error
Unsupported minimum should match dsl {}. quickwit currently
Error message
Unsupported minimum should match dsl {}. quickwit currently only supports the format '35%' and `-35%` What it means
Elasticsearch-style bool queries accept `minimum_should_match` as a percentage string or combination syntax. Quickwit only supports plain percentage strings like '35%' and negative percentages like '-35%'. Any other DSL string (e.g. '2<75%', combinations '3<90% 2', or bare integers as strings) fails percentage parsing and is rejected.
Source
Thrown at quickwit/quickwit-query/src/elastic_query_dsl/bool_query.rs:65
}
// `IgnoredAny` implements `PartialEq` but not `Eq`, so we derive `PartialEq`
// and manually assert `Eq` (safe because `IgnoredAny` is a unit struct).
impl Eq for BoolQuery {}
#[derive(Deserialize, Debug, Eq, PartialEq, Clone)]
#[serde(untagged)]
pub enum MinimumShouldMatch {
Str(String),
Int(isize),
}
impl MinimumShouldMatch {
fn resolve(&self, num_should_clauses: usize) -> anyhow::Result<MinimumShouldMatchResolved> {
match self {
MinimumShouldMatch::Str(minimum_should_match_dsl) => {
let Some(percentage) = parse_percentage(minimum_should_match_dsl) else {
anyhow::bail!(
"Unsupported minimum should match dsl {}. quickwit currently only \
supports the format '35%' and `-35%`",
minimum_should_match_dsl
);
};
let min_should_match = percentage * num_should_clauses as isize / 100;
MinimumShouldMatch::Int(min_should_match).resolve(num_should_clauses)
}
MinimumShouldMatch::Int(neg_num_missing_should_clauses)
if *neg_num_missing_should_clauses < 0 =>
{
let num_missing_should_clauses = -neg_num_missing_should_clauses as usize;
if num_missing_should_clauses >= num_should_clauses {
Ok(MinimumShouldMatchResolved::Unspecified)
} else {
Ok(MinimumShouldMatchResolved::Min(
num_should_clauses - num_missing_should_clauses,
))View on GitHub (pinned to a39730c5cd)
Solutions
- Rewrite minimum_should_match as a percentage string ('35%' or '-35%').
- Convert combination syntaxes manually: compute the effective count for your clause count and inline the percentage.
- Use the integer (NonStr) MinimumShouldMatch variant if an absolute count is needed.
- Pre-validate the DSL string with a regex like ^-?\d+%$ before building the query.
Example fix
// before
{ "bool": { "minimum_should_match": "2<75%", "should": [...] } }
// after: pre-compute for your clause count
{ "bool": { "minimum_should_match": "75%", "should": [...] } } Defensive patterns
Strategy: validation
Validate before calling
fn is_supported_msm(v: &str) -> bool {
v.strip_prefix('-').unwrap_or(v).ends_with('%')
&& v.strip_prefix('-').unwrap_or(v).trim_end_matches('%').parse::<u64>().is_ok()
}
// reject before building the query: anyhow::ensure!(is_supported_msm(msm), ...) Try / catch
match build_bool_query(dsl) {
Err(e) if e.to_string().contains("Unsupported minimum should match") => {
// fall back to an explicit should-clause count or default '0%'
}
other => other,
} Prevention
- Only emit 'N%' or '-N%' forms of minimum_should_match when targeting Quickwit.
- Pre-convert Elasticsearch combination syntaxes before sending queries.
- Document the supported subset for query-authoring tools.
When it happens
Trigger: Submitting a bool query via quickwit-query's Elastic DSL with minimum_should_match set to a Str variant that parse_percentage cannot parse — e.g. '75', '2<-25%', '3<90% 2', '>=3'.
Common situations: Porting Elasticsearch queries that use combination or conditional minimum_should_match syntaxes; users writing a bare number as a string expecting absolute-count semantics.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- failed to parse range query date format. {err}
- Failed to parse date time: {}
- failed to parse host: `{host}`
- failed to parse address `{}`: hostname is invalid
- unknown URI protocol `{protocol}`
AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08).
Data as JSON: /api/errors/8a24ac169c3e2711.
Report an issue: GitHub.