mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
move default implementation of word_pair_frequency to TestContext
This commit is contained in:
parent
ff8b2d4422
commit
32f825d442
@ -155,12 +155,7 @@ trait Context {
|
|||||||
left_word: &str,
|
left_word: &str,
|
||||||
right_word: &str,
|
right_word: &str,
|
||||||
_proximity: u8,
|
_proximity: u8,
|
||||||
) -> heed::Result<Option<u64>> {
|
) -> heed::Result<Option<u64>>;
|
||||||
match self.word_docids(&format!("{} {}", left_word, right_word))? {
|
|
||||||
Some(rb) => Ok(Some(rb.len())),
|
|
||||||
None => Ok(None),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The query tree builder is the interface to build a query tree.
|
/// The query tree builder is the interface to build a query tree.
|
||||||
@ -850,6 +845,18 @@ mod test {
|
|||||||
fn exact_words(&self) -> Option<&fst::Set<Cow<[u8]>>> {
|
fn exact_words(&self) -> Option<&fst::Set<Cow<[u8]>>> {
|
||||||
self.exact_words.as_ref()
|
self.exact_words.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn word_pair_frequency(
|
||||||
|
&self,
|
||||||
|
left_word: &str,
|
||||||
|
right_word: &str,
|
||||||
|
_proximity: u8,
|
||||||
|
) -> heed::Result<Option<u64>> {
|
||||||
|
match self.word_docids(&format!("{} {}", left_word, right_word))? {
|
||||||
|
Some(rb) => Ok(Some(rb.len())),
|
||||||
|
None => Ok(None),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TestContext {
|
impl Default for TestContext {
|
||||||
|
Loading…
Reference in New Issue
Block a user