Rename the Exact criterion into Exactness

This commit is contained in:
Clément Renault 2020-01-31 11:45:57 +01:00 committed by Clément Renault
parent 8e6560d102
commit 9d167c08f4
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
6 changed files with 16 additions and 16 deletions

View file

@ -6,10 +6,10 @@ use crate::{RawDocument, MResult};
use crate::bucket_sort::BareMatch;
use super::{Criterion, Context, ContextMut};
pub struct Exact;
pub struct Exactness;
impl Criterion for Exact {
fn name(&self) -> &str { "exact" }
impl Criterion for Exactness {
fn name(&self) -> &str { "exactness" }
fn prepare<'h, 'p, 'tag, 'txn, 'q, 'r>(
&self,

View file

@ -16,7 +16,7 @@ mod words;
mod proximity;
mod attribute;
mod words_position;
mod exact;
mod exactness;
mod document_id;
mod sort_by_attr;
@ -25,7 +25,7 @@ pub use self::words::Words;
pub use self::proximity::Proximity;
pub use self::attribute::Attribute;
pub use self::words_position::WordsPosition;
pub use self::exact::Exact;
pub use self::exactness::Exactness;
pub use self::document_id::DocumentId;
pub use self::sort_by_attr::SortByAttr;
@ -124,7 +124,7 @@ impl<'a> Default for Criteria<'a> {
.add(Proximity)
.add(Attribute)
.add(WordsPosition)
.add(Exact)
.add(Exactness)
.add(DocumentId)
.build()
}

View file

@ -32,7 +32,7 @@ use super::{Criterion, Context};
/// .add(Proximity)
/// .add(Attribute)
/// .add(WordsPosition)
/// .add(Exact)
/// .add(Exactness)
/// .add(custom_ranking)
/// .add(DocumentId);
///

View file

@ -93,7 +93,7 @@ pub enum RankingRule {
Proximity,
Attribute,
WordsPosition,
Exact,
Exactness,
Asc(String),
Dsc(String),
}
@ -106,7 +106,7 @@ impl ToString for RankingRule {
RankingRule::Proximity => "_proximity".to_string(),
RankingRule::Attribute => "_attribute".to_string(),
RankingRule::WordsPosition => "_words_position".to_string(),
RankingRule::Exact => "_exact".to_string(),
RankingRule::Exactness => "_exactness".to_string(),
RankingRule::Asc(field) => format!("asc({})", field),
RankingRule::Dsc(field) => format!("dsc({})", field),
}
@ -123,7 +123,7 @@ impl FromStr for RankingRule {
"_proximity" => RankingRule::Proximity,
"_attribute" => RankingRule::Attribute,
"_words_position" => RankingRule::WordsPosition,
"_exact" => RankingRule::Exact,
"_exactness" => RankingRule::Exactness,
_ => {
let captures = RANKING_RULE_REGEX.captures(s).ok_or(RankingRuleConversionError)?;
match (captures.get(1).map(|m| m.as_str()), captures.get(2)) {