mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-14 16:56:25 +00:00
Replace hardcoded string with constants
This commit is contained in:
@ -50,6 +50,7 @@ use self::graph_based_ranking_rule::Words;
|
||||
use self::interner::Interned;
|
||||
use self::vector_sort::VectorSort;
|
||||
use crate::index::PrefixSearch;
|
||||
use crate::constants::RESERVED_GEO_FIELD_NAME;
|
||||
use crate::localized_attributes_rules::LocalizedFieldIds;
|
||||
use crate::score_details::{ScoreDetails, ScoringStrategy};
|
||||
use crate::search::new::distinct::apply_distinct_rule;
|
||||
@ -863,12 +864,12 @@ fn check_sort_criteria(
|
||||
}
|
||||
.into());
|
||||
}
|
||||
Member::Geo(_) if !sortable_fields.contains("_geo") => {
|
||||
Member::Geo(_) if !sortable_fields.contains(RESERVED_GEO_FIELD_NAME) => {
|
||||
let (valid_fields, hidden_fields) =
|
||||
ctx.index.remove_hidden_fields(ctx.txn, sortable_fields)?;
|
||||
|
||||
return Err(UserError::InvalidSortableAttribute {
|
||||
field: "_geo".to_string(),
|
||||
field: RESERVED_GEO_FIELD_NAME.to_string(),
|
||||
valid_fields,
|
||||
hidden_fields,
|
||||
}
|
||||
|
Reference in New Issue
Block a user