mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Add more debug infos
This commit is contained in:
parent
ef6a4db182
commit
d17d4dc5ec
5 changed files with 39 additions and 408 deletions
|
@ -7,6 +7,7 @@ use std::{cmp, fmt, vec};
|
|||
use fst::{IntoStreamer, Streamer};
|
||||
use levenshtein_automata::DFA;
|
||||
use meilisearch_tokenizer::{is_cjk, split_query_string};
|
||||
use log::debug;
|
||||
|
||||
use crate::database::MainT;
|
||||
use crate::error::MResult;
|
||||
|
@ -38,6 +39,10 @@ impl AutomatonProducer {
|
|||
synonyms_store,
|
||||
)?;
|
||||
|
||||
for (i, group) in automatons.iter().enumerate() {
|
||||
debug!("all automatons: group {} automatons {:?}", i, group.automatons);
|
||||
}
|
||||
|
||||
Ok((AutomatonProducer { automatons }, query_enhancer))
|
||||
}
|
||||
|
||||
|
@ -80,7 +85,9 @@ pub struct Automaton {
|
|||
impl fmt::Debug for Automaton {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Automaton")
|
||||
.field("index", &self.index)
|
||||
.field("query", &self.query)
|
||||
.field("is_prefix", &self.is_prefix)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ where
|
|||
type Origin = usize;
|
||||
type RealLength = usize;
|
||||
|
||||
#[derive(Debug)]
|
||||
struct FakeIntervalTree {
|
||||
intervals: Vec<(Range<usize>, (Origin, RealLength))>,
|
||||
}
|
||||
|
@ -154,6 +155,7 @@ impl<S: AsRef<str>> QueryEnhancerBuilder<'_, S> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct QueryEnhancer {
|
||||
origins: Vec<usize>,
|
||||
real_to_origin: FakeIntervalTree,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue