mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
handle the case where you forgot entirely the parenthesis
This commit is contained in:
parent
ebf82ac28c
commit
6d5762a6c8
@ -797,6 +797,12 @@ mod tests {
|
|||||||
);
|
);
|
||||||
assert_eq!(condition, expected);
|
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
|
// georadius don't have any parameters
|
||||||
let result = FilterCondition::from_str(&rtxn, &index, "_geoRadius()");
|
let result = FilterCondition::from_str(&rtxn, &index, "_geoRadius()");
|
||||||
assert!(result.is_err());
|
assert!(result.is_err());
|
||||||
|
@ -9,7 +9,7 @@ char = _{ !(PEEK | "\\") ~ ANY
|
|||||||
| "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})}
|
| "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})}
|
||||||
|
|
||||||
// we deliberately choose to allow empty parameters to generate more specific error message later
|
// 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}
|
condition = _{between | eq | greater | less | geq | leq | neq}
|
||||||
between = {key ~ value ~ "TO" ~ value}
|
between = {key ~ value ~ "TO" ~ value}
|
||||||
geq = {key ~ ">=" ~ value}
|
geq = {key ~ ">=" ~ value}
|
||||||
|
Loading…
Reference in New Issue
Block a user