mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
Update query term structure to allow for laziness
This commit is contained in:
parent
3a818c5e87
commit
9507ff5e31
@ -373,7 +373,7 @@ impl<'ctx, G: RankingRuleGraphTrait> RankingRule<'ctx, QueryGraph> for GraphBase
|
|||||||
if new_term.is_empty() {
|
if new_term.is_empty() {
|
||||||
nodes_to_remove.push(node_id);
|
nodes_to_remove.push(node_id);
|
||||||
} else {
|
} else {
|
||||||
term.value = ctx.term_interner.insert(new_term);
|
term.value = ctx.term_interner.push(new_term);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ use resolve_query_graph::{resolve_query_graph, QueryTermDocIdsCache};
|
|||||||
use roaring::RoaringBitmap;
|
use roaring::RoaringBitmap;
|
||||||
use words::Words;
|
use words::Words;
|
||||||
|
|
||||||
|
use self::interner::Interner;
|
||||||
use self::ranking_rules::{BoxRankingRule, RankingRule};
|
use self::ranking_rules::{BoxRankingRule, RankingRule};
|
||||||
use self::sort::Sort;
|
use self::sort::Sort;
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -46,7 +47,7 @@ pub struct SearchContext<'ctx> {
|
|||||||
pub db_cache: DatabaseCache<'ctx>,
|
pub db_cache: DatabaseCache<'ctx>,
|
||||||
pub word_interner: DedupInterner<String>,
|
pub word_interner: DedupInterner<String>,
|
||||||
pub phrase_interner: DedupInterner<Phrase>,
|
pub phrase_interner: DedupInterner<Phrase>,
|
||||||
pub term_interner: DedupInterner<QueryTerm>,
|
pub term_interner: Interner<QueryTerm>,
|
||||||
// think about memory usage of that field (roaring bitmaps in a hashmap)
|
// think about memory usage of that field (roaring bitmaps in a hashmap)
|
||||||
pub term_docids: QueryTermDocIdsCache,
|
pub term_docids: QueryTermDocIdsCache,
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -128,7 +128,7 @@ impl RankingRuleGraphTrait for TypoGraph {
|
|||||||
nbr_typos as u8 + base_cost,
|
nbr_typos as u8 + base_cost,
|
||||||
Some(
|
Some(
|
||||||
conditions_interner
|
conditions_interner
|
||||||
.insert(TypoCondition { term: term_interner.insert(new_term) }),
|
.insert(TypoCondition { term: term_interner.push(new_term) }),
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user