mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-02-27 12:47:10 +08:00
28 lines
595 B
Rust
28 lines
595 B
Rust
pub mod criterion;
|
|
mod ranked_stream;
|
|
|
|
use crate::{Match, DocumentId};
|
|
|
|
pub use self::ranked_stream::{Config, RankedStream};
|
|
|
|
#[inline]
|
|
fn match_query_index(a: &Match, b: &Match) -> bool {
|
|
a.query_index == b.query_index
|
|
}
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub struct Document {
|
|
pub id: DocumentId,
|
|
pub matches: Vec<Match>,
|
|
}
|
|
|
|
impl Document {
|
|
pub fn new(doc: DocumentId, match_: Match) -> Self {
|
|
unsafe { Self::from_sorted_matches(doc, vec![match_]) }
|
|
}
|
|
|
|
pub unsafe fn from_sorted_matches(id: DocumentId, matches: Vec<Match>) -> Self {
|
|
Self { id, matches }
|
|
}
|
|
}
|