mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-31 10:50:03 +00:00
Add some documentation and use bitmaps instead of hashmaps when possible
This commit is contained in:
@ -51,11 +51,11 @@ pub fn visit_to_node<'transaction, 'from_data>(
|
||||
db_cache: &mut DatabaseCache<'transaction>,
|
||||
to_node: &QueryNode,
|
||||
from_node_data: &'from_data (WordDerivations, i8),
|
||||
) -> Result<Option<Vec<(u8, EdgeDetails<ProximityEdge>)>>> {
|
||||
) -> Result<Vec<(u8, EdgeDetails<ProximityEdge>)>> {
|
||||
let (derivations1, pos1) = from_node_data;
|
||||
let term2 = match &to_node {
|
||||
QueryNode::End => return Ok(Some(vec![(0, EdgeDetails::Unconditional)])),
|
||||
QueryNode::Deleted | QueryNode::Start => return Ok(None),
|
||||
QueryNode::End => return Ok(vec![(0, EdgeDetails::Unconditional)]),
|
||||
QueryNode::Deleted | QueryNode::Start => return Ok(vec![]),
|
||||
QueryNode::Term(term) => term,
|
||||
};
|
||||
let LocatedQueryTerm { value: value2, positions: pos2 } = term2;
|
||||
@ -86,7 +86,7 @@ pub fn visit_to_node<'transaction, 'from_data>(
|
||||
// We want to effectively ignore this pair of terms
|
||||
// Unconditionally walk through the edge without computing the docids
|
||||
// But also what should the cost be?
|
||||
return Ok(Some(vec![(0, EdgeDetails::Unconditional)]));
|
||||
return Ok(vec![(0, EdgeDetails::Unconditional)]);
|
||||
}
|
||||
|
||||
let updb1 = derivations1.use_prefix_db;
|
||||
@ -161,5 +161,5 @@ pub fn visit_to_node<'transaction, 'from_data>(
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
new_edges.push((8 + (ngram_len2 - 1) as u8, EdgeDetails::Unconditional));
|
||||
Ok(Some(new_edges))
|
||||
Ok(new_edges)
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ impl RankingRuleGraphTrait for ProximityGraph {
|
||||
type EdgeDetails = ProximityEdge;
|
||||
type BuildVisitedFromNode = (WordDerivations, i8);
|
||||
|
||||
fn edge_details_dot_label(edge: &Self::EdgeDetails) -> String {
|
||||
fn graphviz_edge_details_label(edge: &Self::EdgeDetails) -> String {
|
||||
let ProximityEdge { pairs, proximity } = edge;
|
||||
format!(", prox {proximity}, {} pairs", pairs.len())
|
||||
}
|
||||
@ -55,7 +55,7 @@ impl RankingRuleGraphTrait for ProximityGraph {
|
||||
db_cache: &mut DatabaseCache<'transaction>,
|
||||
to_node: &QueryNode,
|
||||
from_node_data: &'from_data Self::BuildVisitedFromNode,
|
||||
) -> Result<Option<Vec<(u8, EdgeDetails<Self::EdgeDetails>)>>> {
|
||||
) -> Result<Vec<(u8, EdgeDetails<Self::EdgeDetails>)>> {
|
||||
build::visit_to_node(index, txn, db_cache, to_node, from_node_data)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user