MeiliSearch/meilisearch-lib/src/dump/compat/mod.rs

17 lines
552 B
Rust
Raw Normal View History

pub mod v2;
pub mod v3;
/// Parses the v1 version of the Asc ranking rules `asc(price)`and returns the field name.
pub fn asc_ranking_rule(text: &str) -> Option<&str> {
text.split_once("asc(")
2022-02-28 14:43:22 +01:00
.and_then(|(_, tail)| tail.rsplit_once(')'))
.map(|(field, _)| field)
}
/// Parses the v1 version of the Desc ranking rules `desc(price)`and returns the field name.
pub fn desc_ranking_rule(text: &str) -> Option<&str> {
text.split_once("desc(")
2022-02-28 14:43:22 +01:00
.and_then(|(_, tail)| tail.rsplit_once(')'))
.map(|(field, _)| field)
}