feat: Introduce the RankedMap type

This commit is contained in:
Clément Renault 2019-03-29 17:38:57 +01:00
parent e41c551757
commit f17a05c342
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE
3 changed files with 7 additions and 3 deletions

View File

@ -6,6 +6,7 @@ edition = "2018"
[dependencies]
bincode = "1.1.2"
hashbrown = { version = "0.1.8", features = ["serde"] }
linked-hash-map = { version = "0.5.2", features = ["serde_impl"] }
meilidb-core = { path = "../meilidb-core", version = "0.1.0" }
ordered-float = { version = "1.0.2", features = ["serde"] }

View File

@ -0,0 +1,5 @@
use hashbrown::HashMap;
use meilidb_core::DocumentId;
use crate::{SchemaAttr, Number};
pub type RankedMap = HashMap<(DocumentId, SchemaAttr), Number>;

View File

@ -4,9 +4,7 @@ use std::fmt;
use meilidb_core::criterion::Criterion;
use meilidb_core::RawDocument;
use meilidb_data::{Schema, SchemaAttr};
use meilidb_data::RankedMap;
use meilidb_data::{Schema, SchemaAttr, RankedMap};
/// An helper struct that permit to sort documents by
/// some of their stored attributes.