This commit is contained in:
刘瀚骋 2021-10-12 22:19:28 +08:00
parent d323e35001
commit 2c65781d91
2 changed files with 7 additions and 10 deletions

View File

@ -1,4 +1,3 @@
use std::fmt::Debug;
use std::ops::Bound::{self, Excluded, Included};
@ -16,9 +15,7 @@ use crate::error::{Error, UserError};
use crate::heed_codec::facet::{
FacetLevelValueF64Codec, FacetStringLevelZeroCodec, FacetStringLevelZeroValueCodec,
};
use crate::{
distance_between_two_points, CboRoaringBitmapCodec, FieldId, Index, Result,
};
use crate::{distance_between_two_points, CboRoaringBitmapCodec, FieldId, Index, Result};
#[derive(Debug, Clone, PartialEq)]
pub enum FilterCondition {

View File

@ -215,8 +215,7 @@ impl<'a> ParseContext<'a> {
where
E: ParseError<&'a str> + ContextError<&'a str> + Debug,
{
let err_msg_args_incomplete:&'static str =
"_geoRadius. The `_geoRadius` filter expect three arguments: `_geoRadius(latitude, longitude, radius)`";
let err_msg_args_incomplete:&'static str = "_geoRadius. The `_geoRadius` filter expect three arguments: `_geoRadius(latitude, longitude, radius)`";
let err_msg_args_invalid: &'static str =
"_geoRadius. Latitude and longitude must be contained between -180 to 180 degrees.";
let (input, args): (&str, Vec<&str>) = match preceded(
@ -530,7 +529,8 @@ mod tests {
&rtxn,
&index,
"(NOT _geoRadius(1, 2, 300) AND _geoRadius(1.001, 2.002, 1000.300)) OR price <= 10",
).unwrap();
)
.unwrap();
let expected = FilterCondition::Or(
Box::new(FilterCondition::And(
Box::new(FilterCondition::Operator(0, GeoGreaterThan([1., 2.], 300.))),