Add the criteria list to the index

This commit is contained in:
Clément Renault
2020-11-27 12:14:56 +01:00
parent 57e8e5c965
commit f8f33d35e0
2 changed files with 26 additions and 3 deletions

View File

@ -1,3 +1,8 @@
use crate::FieldId;
use serde::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq)]
pub enum Criterion {
/// Sorted by increasing number of typos.
Typo,
@ -14,9 +19,9 @@ pub enum Criterion {
/// Sorted by the similarity of the matched words with the query words.
Exactness,
/// Sorted by the increasing value of the field specified.
CustomAsc(String),
Asc(FieldId),
/// Sorted by the decreasing value of the field specified.
CustomDesc(String),
Desc(FieldId),
}
pub fn default_criteria() -> Vec<Criterion> {