Don't recompute filterable fields in evaluation of IN[] filter

This commit is contained in:
Loïc Lecrenier 2022-08-18 10:59:21 +02:00
parent 98f0da6b38
commit c51dcad51b

View File

@ -361,10 +361,7 @@ impl<'a> Filter<'a> {
return Ok(all_ids - selected);
}
FilterCondition::In { fid, els } => {
// TODO: this could be optimised
let filterable_fields = index.filterable_fields(rtxn)?;
if crate::is_faceted(fid.value(), &filterable_fields) {
if crate::is_faceted(fid.value(), filterable_fields) {
let field_ids_map = index.fields_ids_map(rtxn)?;
if let Some(fid) = field_ids_map.id(fid.value()) {
@ -382,7 +379,7 @@ impl<'a> Filter<'a> {
} else {
return Err(fid.as_external_error(FilterError::AttributeNotFilterable {
attribute: fid.value(),
filterable_fields,
filterable_fields: filterable_fields.clone(),
}))?;
}
}