mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
Introduce the Crtierion enum
This commit is contained in:
parent
6d04a285dc
commit
bfb46cbfbe
31
src/criterion.rs
Normal file
31
src/criterion.rs
Normal file
@ -0,0 +1,31 @@
|
||||
pub enum Criterion {
|
||||
/// Sorted by increasing number of typos.
|
||||
Typo,
|
||||
/// Sorted by decreasing number of matched query terms.
|
||||
Words,
|
||||
/// Sorted by increasing distance between matched query terms.
|
||||
Proximity,
|
||||
/// Documents with quey words contained in more important
|
||||
/// attributes are considred better.
|
||||
Attribute,
|
||||
/// Documents with query words at the front of an attribute is
|
||||
/// considered better than if it was at the back.
|
||||
WordsPosition,
|
||||
/// Sorted by the similarity of the matched words with the query words.
|
||||
Exactness,
|
||||
/// Sorted by the increasing value of the field specified.
|
||||
CustomAsc(String),
|
||||
/// Sorted by the decreasing value of the field specified.
|
||||
CustomDesc(String),
|
||||
}
|
||||
|
||||
pub fn default_criteria() -> Vec<Criterion> {
|
||||
vec![
|
||||
Criterion::Typo,
|
||||
Criterion::Words,
|
||||
Criterion::Proximity,
|
||||
Criterion::Attribute,
|
||||
Criterion::WordsPosition,
|
||||
Criterion::Exactness,
|
||||
]
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
mod best_proximity;
|
||||
mod criterion;
|
||||
mod heed_codec;
|
||||
mod iter_shortest_paths;
|
||||
mod query_tokens;
|
||||
|
Loading…
Reference in New Issue
Block a user