mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
only index _geo if it's set as sortable OR filterable
and only allow the filters if geo was set to filterable
This commit is contained in:
parent
f73273d71c
commit
5bb175fc90
3 changed files with 15 additions and 1 deletions
|
@ -463,6 +463,9 @@ impl FilterCondition {
|
|||
LowerThanOrEqual(val) => (Included(f64::MIN), Included(*val)),
|
||||
Between(left, right) => (Included(*left), Included(*right)),
|
||||
GeoLowerThan(point, distance) => {
|
||||
if index.filterable_fields(rtxn)?.contains("_geo") {
|
||||
Err(UserError::AttributeLimitReached)?; // TODO: TAMO use a real error
|
||||
}
|
||||
let mut result = RoaringBitmap::new();
|
||||
let rtree = match index.geo_rtree(rtxn)? {
|
||||
Some(rtree) => rtree,
|
||||
|
@ -477,6 +480,9 @@ impl FilterCondition {
|
|||
return Ok(result);
|
||||
}
|
||||
GeoGreaterThan(point, distance) => {
|
||||
if index.filterable_fields(rtxn)?.contains("_geo") {
|
||||
Err(UserError::AttributeLimitReached)?; // TODO: TAMO use a real error
|
||||
}
|
||||
let result = Self::evaluate_operator(
|
||||
rtxn,
|
||||
index,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue