From 65a3086cf11461054e9eb0de5d5d31dfd80c3f9e Mon Sep 17 00:00:00 2001 From: Guillaume Mourier Date: Fri, 28 Oct 2022 18:22:26 +0200 Subject: [PATCH] fix test --- milli/src/asc_desc.rs | 2 +- milli/src/criterion.rs | 2 +- milli/src/error.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/milli/src/asc_desc.rs b/milli/src/asc_desc.rs index a460be503..444819c34 100644 --- a/milli/src/asc_desc.rs +++ b/milli/src/asc_desc.rs @@ -92,7 +92,7 @@ impl FromStr for Member { Ok(Member::Geo([lat, lng])) } None => { - if is_reserved_keyword(text) || text.starts_with("_geoRadius(") { + if is_reserved_keyword(text) || text.starts_with("_geoRadius(") || text.starts_with("_geoBoundingBox(") { return Err(AscDescError::ReservedKeyword { name: text.to_string() })?; } Ok(Member::Field(text.to_string())) diff --git a/milli/src/criterion.rs b/milli/src/criterion.rs index 4544a97ac..23e2ac7f1 100644 --- a/milli/src/criterion.rs +++ b/milli/src/criterion.rs @@ -160,7 +160,7 @@ mod tests { ("_geoRadius:asc", ReservedNameForFilter { name: S("_geoRadius") }), ("_geoRadius(42, 75, 59):asc", ReservedNameForFilter { name: S("_geoRadius") }), ("_geoBoundingBox:asc", ReservedNameForFilter { name: S("_geoBoundingBox") }), - ("_geoBoundinxBox((42, 75), (75, 59)):asc", ReservedNameForFilter { name: S("_geoBoundingBox") }), + ("_geoBoundingBox((42, 75), (75, 59)):asc", ReservedNameForFilter { name: S("_geoBoundingBox") }), ]; for (input, expected) in invalid_criteria { diff --git a/milli/src/error.rs b/milli/src/error.rs index 8734cb540..92c238814 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -11,7 +11,7 @@ use crate::documents::{self, DocumentsBatchCursorError}; use crate::{CriterionError, DocumentId, FieldId, Object, SortError}; pub fn is_reserved_keyword(keyword: &str) -> bool { - ["_geo", "_geoDistance", "_geoPoint", "_geoRadius"].contains(&keyword) + ["_geo", "_geoDistance", "_geoPoint", "_geoRadius", "_geoBoundingBox"].contains(&keyword) } #[derive(Error, Debug)]