mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-09 22:48:54 +01:00
Introduce the FieldIdFacetIsNullDocidsExtractor
This commit is contained in:
parent
9c0a1cd9fd
commit
b33ec9ba3f
@ -210,7 +210,25 @@ impl FacetedExtractor for FieldIdFacetStringDocidsExtractor {
|
||||
}
|
||||
}
|
||||
|
||||
// Extract fieldid facet isnull docids
|
||||
pub struct FieldIdFacetIsNullDocidsExtractor;
|
||||
impl FacetedExtractor for FieldIdFacetIsNullDocidsExtractor {
|
||||
fn attributes_to_extract<'a>(rtxn: &'a RoTxn, index: &'a Index) -> Result<HashSet<String>> {
|
||||
index.user_defined_faceted_fields(rtxn)
|
||||
}
|
||||
|
||||
fn build_key<'b>(
|
||||
field_id: FieldId,
|
||||
value: &Value,
|
||||
output: &'b mut Vec<u8>,
|
||||
) -> Option<&'b [u8]> {
|
||||
if value.is_null() {
|
||||
output.extend_from_slice(&field_id.to_be_bytes());
|
||||
Some(&*output)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FieldIdFacetExistsDocidsExtractor;
|
||||
impl FacetedExtractor for FieldIdFacetExistsDocidsExtractor {
|
||||
|
Loading…
Reference in New Issue
Block a user