mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 12:35:05 +08:00
Apply PR comments
This commit is contained in:
parent
1bd15d849b
commit
085bc6440c
@ -195,15 +195,13 @@ impl<'t> QueryPositionIterator<'t> {
|
|||||||
match &query.kind {
|
match &query.kind {
|
||||||
QueryKind::Exact { word, .. } => {
|
QueryKind::Exact { word, .. } => {
|
||||||
if !query.prefix || in_prefix_cache {
|
if !query.prefix || in_prefix_cache {
|
||||||
let iter =
|
let word = query.kind.word();
|
||||||
ctx.word_position_iterator(query.kind.word(), in_prefix_cache)?;
|
let iter = ctx.word_position_iterator(word, in_prefix_cache)?;
|
||||||
|
|
||||||
inner.push(iter.peekable());
|
inner.push(iter.peekable());
|
||||||
} else {
|
} else {
|
||||||
for (word, _) in word_derivations(&word, true, 0, ctx.words_fst(), wdcache)?
|
for (word, _) in word_derivations(&word, true, 0, ctx.words_fst(), wdcache)?
|
||||||
{
|
{
|
||||||
let iter = ctx.word_position_iterator(&word, in_prefix_cache)?;
|
let iter = ctx.word_position_iterator(&word, in_prefix_cache)?;
|
||||||
|
|
||||||
inner.push(iter.peekable());
|
inner.push(iter.peekable());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,7 +211,6 @@ impl<'t> QueryPositionIterator<'t> {
|
|||||||
word_derivations(&word, query.prefix, *typo, ctx.words_fst(), wdcache)?
|
word_derivations(&word, query.prefix, *typo, ctx.words_fst(), wdcache)?
|
||||||
{
|
{
|
||||||
let iter = ctx.word_position_iterator(&word, in_prefix_cache)?;
|
let iter = ctx.word_position_iterator(&word, in_prefix_cache)?;
|
||||||
|
|
||||||
inner.push(iter.peekable());
|
inner.push(iter.peekable());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -305,16 +302,14 @@ impl<'t> Branch<'t> {
|
|||||||
Some((next_pos, next_docids)) => {
|
Some((next_pos, next_docids)) => {
|
||||||
*cur_pos = next_pos;
|
*cur_pos = next_pos;
|
||||||
*cur_docids |= next_docids & allowed_candidates;
|
*cur_docids |= next_docids & allowed_candidates;
|
||||||
}
|
|
||||||
None => return Ok(false),
|
|
||||||
},
|
|
||||||
None => return Ok(false),
|
|
||||||
}
|
|
||||||
|
|
||||||
self.update_last_result();
|
self.update_last_result();
|
||||||
|
|
||||||
Ok(true)
|
Ok(true)
|
||||||
}
|
}
|
||||||
|
None => Ok(false),
|
||||||
|
},
|
||||||
|
None => Ok(false),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn lowest_iterator_index(&mut self) -> usize {
|
fn lowest_iterator_index(&mut self) -> usize {
|
||||||
let (index, _) = self
|
let (index, _) = self
|
||||||
|
Loading…
Reference in New Issue
Block a user