Improve the visual/detailed search logger

This commit is contained in:
Loïc Lecrenier
2023-02-23 13:13:19 +01:00
parent 6ba4d5e987
commit 173e37584c
9 changed files with 192 additions and 24 deletions

View File

@ -3,6 +3,7 @@ pub mod compute_docids;
use heed::RoTxn;
use super::paths_map::PathsMap;
use super::{Edge, EdgeDetails, RankingRuleGraphTrait};
use crate::new::db_cache::DatabaseCache;
use crate::new::query_term::WordDerivations;
@ -18,6 +19,7 @@ pub enum WordPair {
WordPrefixSwapped { left: String, right_prefix: String },
}
#[derive(Clone)]
pub struct ProximityEdge {
pairs: Vec<WordPair>,
proximity: u8,
@ -61,4 +63,12 @@ impl RankingRuleGraphTrait for ProximityGraph {
) -> Result<Vec<(u8, EdgeDetails<Self::EdgeDetails>)>> {
build::visit_to_node(index, txn, db_cache, to_node, from_node_data)
}
fn log_state(
graph: &super::RankingRuleGraph<Self>,
paths: &PathsMap<u64>,
logger: &mut dyn crate::new::logger::SearchLogger<crate::new::QueryGraph>,
) {
logger.log_proximity_state(graph, paths);
}
}