From d0786b415609f5e65d73aa6a90cff4a5aba571e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sun, 24 Feb 2019 19:53:52 +0100 Subject: [PATCH] chore: Move the SortByAttr into meilidb --- meilidb-core/src/criterion/mod.rs | 2 -- meilidb/src/lib.rs | 2 ++ {meilidb-core/src/criterion => meilidb/src}/sort_by_attr.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename {meilidb-core/src/criterion => meilidb/src}/sort_by_attr.rs (97%) diff --git a/meilidb-core/src/criterion/mod.rs b/meilidb-core/src/criterion/mod.rs index 3e2fd5028..2ad3a183c 100644 --- a/meilidb-core/src/criterion/mod.rs +++ b/meilidb-core/src/criterion/mod.rs @@ -4,7 +4,6 @@ mod words_proximity; mod sum_of_words_attribute; mod sum_of_words_position; mod exact; -// mod sort_by_attr; mod document_id; use std::cmp::Ordering; @@ -17,7 +16,6 @@ pub use self::{ sum_of_words_attribute::SumOfWordsAttribute, sum_of_words_position::SumOfWordsPosition, exact::Exact, - // sort_by_attr::SortByAttr, document_id::DocumentId, }; diff --git a/meilidb/src/lib.rs b/meilidb/src/lib.rs index ff4df44ea..73de9ff4d 100644 --- a/meilidb/src/lib.rs +++ b/meilidb/src/lib.rs @@ -3,9 +3,11 @@ pub mod database; pub mod tokenizer; mod common_words; +mod sort_by_attr; pub use rocksdb; +pub use self::sort_by_attr::SortByAttr; pub use self::tokenizer::Tokenizer; pub use self::common_words::CommonWords; diff --git a/meilidb-core/src/criterion/sort_by_attr.rs b/meilidb/src/sort_by_attr.rs similarity index 97% rename from meilidb-core/src/criterion/sort_by_attr.rs rename to meilidb/src/sort_by_attr.rs index 8b7b23fa6..24364aaf4 100644 --- a/meilidb-core/src/criterion/sort_by_attr.rs +++ b/meilidb/src/sort_by_attr.rs @@ -2,10 +2,11 @@ use std::cmp::Ordering; use std::error::Error; use std::fmt; +use meilidb_core::criterion::Criterion; +use meilidb_core::RawDocument; + use crate::database::schema::{Schema, SchemaAttr}; -use crate::criterion::Criterion; use crate::database::RankedMap; -use crate::RawDocument; /// An helper struct that permit to sort documents by /// some of their stored attributes.