mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-31 19:00:00 +00:00
WIP
This commit is contained in:
@ -3,7 +3,7 @@ use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Instant;
|
||||
|
||||
use rand::random;
|
||||
// use rand::random;
|
||||
use roaring::RoaringBitmap;
|
||||
|
||||
use crate::search::new::interner::{Interned, MappedInterner};
|
||||
@ -323,12 +323,11 @@ impl DetailedSearchLogger {
|
||||
let cur_activated_id = activated_id(×tamp);
|
||||
let docids = new.iter().collect::<Vec<_>>();
|
||||
let len = new.len();
|
||||
let random = random::<u64>();
|
||||
|
||||
writeln!(
|
||||
&mut file,
|
||||
"{cur_ranking_rule}.{cur_activated_id} -> results.{random} : \"add {len}\"
|
||||
results.{random} {{
|
||||
"{cur_ranking_rule}.{cur_activated_id} -> results.{cur_ranking_rule}{cur_activated_id} : \"add {len}\"
|
||||
results.{cur_ranking_rule}{cur_activated_id} {{
|
||||
tooltip: \"{docids:?}\"
|
||||
style {{
|
||||
fill: \"#B6E2D3\"
|
||||
@ -572,17 +571,17 @@ shape: class"
|
||||
Self::paths_d2_description(ctx, graph, paths, file);
|
||||
writeln!(file, "}}").unwrap();
|
||||
|
||||
writeln!(file, "Dead-end couples of conditions {{").unwrap();
|
||||
for (i, (e1, e2)) in dead_end_paths_cache.condition_couples.iter().enumerate() {
|
||||
writeln!(file, "{i} : \"\" {{").unwrap();
|
||||
Self::condition_d2_description(ctx, graph, e1, file);
|
||||
for e2 in e2.iter() {
|
||||
Self::condition_d2_description(ctx, graph, e2, file);
|
||||
writeln!(file, "{e1} -- {e2}").unwrap();
|
||||
}
|
||||
writeln!(file, "}}").unwrap();
|
||||
}
|
||||
writeln!(file, "}}").unwrap();
|
||||
// writeln!(file, "Dead-end couples of conditions {{").unwrap();
|
||||
// for (i, (e1, e2)) in dead_end_paths_cache.condition_couples.iter().enumerate() {
|
||||
// writeln!(file, "{i} : \"\" {{").unwrap();
|
||||
// Self::condition_d2_description(ctx, graph, e1, file);
|
||||
// for e2 in e2.iter() {
|
||||
// Self::condition_d2_description(ctx, graph, e2, file);
|
||||
// writeln!(file, "{e1} -- {e2}").unwrap();
|
||||
// }
|
||||
// writeln!(file, "}}").unwrap();
|
||||
// }
|
||||
// writeln!(file, "}}").unwrap();
|
||||
|
||||
writeln!(file, "Dead-end edges {{").unwrap();
|
||||
for condition in dead_end_paths_cache.conditions.iter() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#[cfg(test)]
|
||||
// #[cfg(test)]
|
||||
pub mod detailed;
|
||||
|
||||
use roaring::RoaringBitmap;
|
||||
@ -6,8 +6,7 @@ use roaring::RoaringBitmap;
|
||||
use super::interner::{Interned, MappedInterner};
|
||||
use super::query_graph::QueryNode;
|
||||
use super::ranking_rule_graph::{
|
||||
DeadEndPathCache, ProximityCondition, ProximityGraph, RankingRuleGraph, TypoCondition,
|
||||
TypoGraph,
|
||||
DeadEndsCache, ProximityCondition, ProximityGraph, RankingRuleGraph, TypoCondition, TypoGraph,
|
||||
};
|
||||
use super::small_bitmap::SmallBitmap;
|
||||
use super::{RankingRule, RankingRuleQueryTrait};
|
||||
@ -67,7 +66,7 @@ pub trait SearchLogger<Q: RankingRuleQueryTrait> {
|
||||
&mut self,
|
||||
query_graph: &RankingRuleGraph<ProximityGraph>,
|
||||
paths: &[Vec<Interned<ProximityCondition>>],
|
||||
dead_end_path_cache: &DeadEndPathCache<ProximityGraph>,
|
||||
dead_end_path_cache: &DeadEndsCache<ProximityCondition>,
|
||||
universe: &RoaringBitmap,
|
||||
distances: &MappedInterner<Vec<(u16, SmallBitmap<ProximityCondition>)>, QueryNode>,
|
||||
cost: u16,
|
||||
@ -78,7 +77,7 @@ pub trait SearchLogger<Q: RankingRuleQueryTrait> {
|
||||
&mut self,
|
||||
query_graph: &RankingRuleGraph<TypoGraph>,
|
||||
paths: &[Vec<Interned<TypoCondition>>],
|
||||
dead_end_path_cache: &DeadEndPathCache<TypoGraph>,
|
||||
dead_end_path_cache: &DeadEndsCache<TypoCondition>,
|
||||
universe: &RoaringBitmap,
|
||||
distances: &MappedInterner<Vec<(u16, SmallBitmap<TypoCondition>)>, QueryNode>,
|
||||
cost: u16,
|
||||
@ -138,7 +137,7 @@ impl<Q: RankingRuleQueryTrait> SearchLogger<Q> for DefaultSearchLogger {
|
||||
&mut self,
|
||||
_query_graph: &RankingRuleGraph<ProximityGraph>,
|
||||
_paths_map: &[Vec<Interned<ProximityCondition>>],
|
||||
_dead_end_path_cache: &DeadEndPathCache<ProximityGraph>,
|
||||
_dead_end_path_cache: &DeadEndsCache<ProximityCondition>,
|
||||
_universe: &RoaringBitmap,
|
||||
_distances: &MappedInterner<Vec<(u16, SmallBitmap<ProximityCondition>)>, QueryNode>,
|
||||
_cost: u16,
|
||||
@ -149,7 +148,7 @@ impl<Q: RankingRuleQueryTrait> SearchLogger<Q> for DefaultSearchLogger {
|
||||
&mut self,
|
||||
_query_graph: &RankingRuleGraph<TypoGraph>,
|
||||
_paths: &[Vec<Interned<TypoCondition>>],
|
||||
_dead_end_path_cache: &DeadEndPathCache<TypoGraph>,
|
||||
_dead_end_path_cache: &DeadEndsCache<TypoCondition>,
|
||||
_universe: &RoaringBitmap,
|
||||
_distances: &MappedInterner<Vec<(u16, SmallBitmap<TypoCondition>)>, QueryNode>,
|
||||
_cost: u16,
|
||||
|
Reference in New Issue
Block a user