mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
feat: Implement Debug on RawDocument for more convenience
This commit is contained in:
parent
6df8f62022
commit
94f9587db1
@ -4,6 +4,7 @@ mod query_builder;
|
||||
mod store;
|
||||
pub mod criterion;
|
||||
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
use rayon::slice::ParallelSliceMut;
|
||||
@ -210,6 +211,21 @@ impl RawDocument {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for RawDocument {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.debug_struct("RawDocument")
|
||||
.field("id", &self.id)
|
||||
.field("query_index", &self.query_index())
|
||||
.field("distance", &self.distance())
|
||||
.field("attribute", &self.attribute())
|
||||
.field("word_index", &self.word_index())
|
||||
.field("is_exact", &self.is_exact())
|
||||
.field("char_index", &self.char_index())
|
||||
.field("char_length", &self.char_length())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn raw_documents_from_matches(mut matches: Vec<(DocumentId, Match)>) -> Vec<RawDocument> {
|
||||
let mut docs_ranges = Vec::<(DocumentId, Range)>::new();
|
||||
let mut matches2 = Matches::with_capacity(matches.len());
|
||||
|
Loading…
Reference in New Issue
Block a user