mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
remove underscore and introduce back word_documents_count
This commit is contained in:
parent
8195fc6141
commit
85f3028317
@ -160,7 +160,7 @@ trait Context {
|
|||||||
&self,
|
&self,
|
||||||
left_word: &str,
|
left_word: &str,
|
||||||
right_word: &str,
|
right_word: &str,
|
||||||
_proximity: u8,
|
proximity: u8,
|
||||||
) -> heed::Result<Option<u64>>;
|
) -> heed::Result<Option<u64>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,6 +183,10 @@ impl<'a> Context for QueryTreeBuilder<'a> {
|
|||||||
self.index.words_synonyms(self.rtxn, words)
|
self.index.words_synonyms(self.rtxn, words)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn word_documents_count(&self, word: &str) -> heed::Result<Option<u64>> {
|
||||||
|
self.index.word_documents_count(self.rtxn, word)
|
||||||
|
}
|
||||||
|
|
||||||
fn min_word_len_for_typo(&self) -> heed::Result<(u8, u8)> {
|
fn min_word_len_for_typo(&self) -> heed::Result<(u8, u8)> {
|
||||||
let one = self.index.min_word_len_one_typo(&self.rtxn)?;
|
let one = self.index.min_word_len_one_typo(&self.rtxn)?;
|
||||||
let two = self.index.min_word_len_two_typos(&self.rtxn)?;
|
let two = self.index.min_word_len_two_typos(&self.rtxn)?;
|
||||||
@ -511,7 +515,7 @@ fn create_query_tree(
|
|||||||
.filter(|(_, part)| !part.is_phrase())
|
.filter(|(_, part)| !part.is_phrase())
|
||||||
.max_by_key(|(_, part)| match part {
|
.max_by_key(|(_, part)| match part {
|
||||||
PrimitiveQueryPart::Word(s, _) => {
|
PrimitiveQueryPart::Word(s, _) => {
|
||||||
ctx.word_documents_count(s).unwrap_or_default().unwrap_or(u64::max_value());
|
ctx.word_documents_count(s).unwrap_or_default().unwrap_or(u64::max_value())
|
||||||
}
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user