mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Use the new Asc/Desc syntax everywhere
This commit is contained in:
parent
fcedff95e8
commit
5b88df508e
4 changed files with 12 additions and 12 deletions
|
@ -15,7 +15,7 @@ pub enum Criterion {
|
|||
/// Sorted by increasing distance between matched query terms.
|
||||
Proximity,
|
||||
/// Documents with quey words contained in more important
|
||||
/// attributes are considred better.
|
||||
/// attributes are considered better.
|
||||
Attribute,
|
||||
/// Sorted by the similarity of the matched words with the query words.
|
||||
Exactness,
|
||||
|
@ -74,8 +74,8 @@ impl fmt::Display for Criterion {
|
|||
Proximity => f.write_str("proximity"),
|
||||
Attribute => f.write_str("attribute"),
|
||||
Exactness => f.write_str("exactness"),
|
||||
Asc(attr) => write!(f, "asc({})", attr),
|
||||
Desc(attr) => write!(f, "desc({})", attr),
|
||||
Asc(attr) => write!(f, "{}:asc", attr),
|
||||
Desc(attr) => write!(f, "{}:desc", attr),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -719,7 +719,7 @@ mod tests {
|
|||
let mut builder = Settings::new(&mut wtxn, &index, 0);
|
||||
// Don't display the generated `id` field.
|
||||
builder.set_displayed_fields(vec![S("name")]);
|
||||
builder.set_criteria(vec![S("asc(age)")]);
|
||||
builder.set_criteria(vec![S("age:asc")]);
|
||||
builder.execute(|_, _| ()).unwrap();
|
||||
|
||||
// Then index some documents.
|
||||
|
@ -953,7 +953,7 @@ mod tests {
|
|||
let mut builder = Settings::new(&mut wtxn, &index, 0);
|
||||
builder.set_displayed_fields(vec!["hello".to_string()]);
|
||||
builder.set_filterable_fields(hashset! { S("age"), S("toto") });
|
||||
builder.set_criteria(vec!["asc(toto)".to_string()]);
|
||||
builder.set_criteria(vec!["toto:asc".to_string()]);
|
||||
builder.execute(|_, _| ()).unwrap();
|
||||
wtxn.commit().unwrap();
|
||||
|
||||
|
@ -990,7 +990,7 @@ mod tests {
|
|||
let mut builder = Settings::new(&mut wtxn, &index, 0);
|
||||
builder.set_displayed_fields(vec!["hello".to_string()]);
|
||||
// It is only Asc(toto), there is a facet database but it is denied to filter with toto.
|
||||
builder.set_criteria(vec!["asc(toto)".to_string()]);
|
||||
builder.set_criteria(vec!["toto:asc".to_string()]);
|
||||
builder.execute(|_, _| ()).unwrap();
|
||||
wtxn.commit().unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue