mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
Merge #915
915: fix unwrap bug r=Kerollmops a=MarinPostma fix #912. Co-authored-by: mpostma <postma.marin@protonmail.com>
This commit is contained in:
commit
89b5ae63fc
@ -9,7 +9,7 @@ use std::time::Instant;
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use compact_arena::{SmallArena, Idx32, mk_arena};
|
use compact_arena::{SmallArena, Idx32, mk_arena};
|
||||||
use log::debug;
|
use log::{debug, error};
|
||||||
use sdset::{Set, SetBuf, exponential_search, SetOperation, Counter, duo::OpBuilder};
|
use sdset::{Set, SetBuf, exponential_search, SetOperation, Counter, duo::OpBuilder};
|
||||||
use slice_group_by::{GroupBy, GroupByMut};
|
use slice_group_by::{GroupBy, GroupByMut};
|
||||||
|
|
||||||
@ -370,12 +370,18 @@ where
|
|||||||
let mut documents = Vec::with_capacity(range.len());
|
let mut documents = Vec::with_capacity(range.len());
|
||||||
for raw_document in raw_documents.into_iter().skip(distinct_raw_offset) {
|
for raw_document in raw_documents.into_iter().skip(distinct_raw_offset) {
|
||||||
let filter_accepted = match &filter {
|
let filter_accepted = match &filter {
|
||||||
Some(_) => filter_map.remove(&raw_document.id).unwrap(),
|
Some(_) => filter_map.remove(&raw_document.id).unwrap_or_else(|| {
|
||||||
|
error!("error during filtering: expected value for document id {}", &raw_document.id.0);
|
||||||
|
Default::default()
|
||||||
|
}),
|
||||||
None => true,
|
None => true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if filter_accepted {
|
if filter_accepted {
|
||||||
let key = key_cache.remove(&raw_document.id).unwrap();
|
let key = key_cache.remove(&raw_document.id).unwrap_or_else(|| {
|
||||||
|
error!("error during distinct: expected value for document id {}", &raw_document.id.0);
|
||||||
|
Default::default()
|
||||||
|
});
|
||||||
let distinct_accepted = match key {
|
let distinct_accepted = match key {
|
||||||
Some(key) => seen.register(key),
|
Some(key) => seen.register(key),
|
||||||
None => seen.register_without_key(),
|
None => seen.register_without_key(),
|
||||||
|
Loading…
Reference in New Issue
Block a user