diff --git a/milli/src/search/facet/filter_condition.rs b/milli/src/search/facet/filter_condition.rs index bfcf7d9c7..c6dbbf056 100644 --- a/milli/src/search/facet/filter_condition.rs +++ b/milli/src/search/facet/filter_condition.rs @@ -797,6 +797,12 @@ mod tests { ); assert_eq!(condition, expected); + // georadius don't have any parameters + let result = FilterCondition::from_str(&rtxn, &index, "_geoRadius"); + assert!(result.is_err()); + let error = result.unwrap_err(); + assert!(error.to_string().contains("The `_geoRadius` filter expect three arguments: `_geoRadius(latitude, longitude, radius)`")); + // georadius don't have any parameters let result = FilterCondition::from_str(&rtxn, &index, "_geoRadius()"); assert!(result.is_err()); diff --git a/milli/src/search/facet/grammar.pest b/milli/src/search/facet/grammar.pest index 973fb5156..8285f81a6 100644 --- a/milli/src/search/facet/grammar.pest +++ b/milli/src/search/facet/grammar.pest @@ -9,7 +9,7 @@ char = _{ !(PEEK | "\\") ~ ANY | "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})} // we deliberately choose to allow empty parameters to generate more specific error message later -parameters ={"(" ~ (value ~ ",")* ~ value? ~ ")"} +parameters ={("(" ~ (value ~ ",")* ~ value? ~ ")") | ""} condition = _{between | eq | greater | less | geq | leq | neq} between = {key ~ value ~ "TO" ~ value} geq = {key ~ ">=" ~ value}