This commit is contained in:
Clément Renault 2024-11-07 17:35:07 +01:00
parent bf88409075
commit 717a69dc6e
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -5,22 +5,18 @@ use std::io::{self, BufWriter};
use std::mem::{self, size_of}; use std::mem::{self, size_of};
use bincode::ErrorKind; use bincode::ErrorKind;
use bumpalo::Bump;
use heed::RoTxn; use heed::RoTxn;
use raw_collections::bbbul::BitPacker4x; use raw_collections::bbbul::BitPacker4x;
use raw_collections::Bbbul; use raw_collections::Bbbul;
use uell::Uell; use uell::Uell;
use crate::update::new::document::Document; use crate::update::new::document::Document;
use crate::update::new::indexer::document_changes::{ use crate::update::new::indexer::document_changes::{DocumentChangeContext, Extractor, MostlySend};
DocumentChangeContext, Extractor, FullySend, MostlySend,
};
use crate::update::new::ref_cell_ext::RefCellExt as _; use crate::update::new::ref_cell_ext::RefCellExt as _;
use crate::update::new::DocumentChange; use crate::update::new::DocumentChange;
use crate::update::GrenadParameters; use crate::update::GrenadParameters;
use crate::{ use crate::{DocumentId, Index, Result};
CboRoaringBitmapCodec, DocumentId, Error, FieldId, GeoPoint, GlobalFieldsIdsMap, Index,
InternalError, Result,
};
pub struct GeoExtractor { pub struct GeoExtractor {
grenad_parameters: GrenadParameters, grenad_parameters: GrenadParameters,
@ -36,7 +32,6 @@ impl GeoExtractor {
let is_sortable = index.sortable_fields(rtxn)?.contains("_geo"); let is_sortable = index.sortable_fields(rtxn)?.contains("_geo");
let is_filterable = index.filterable_fields(rtxn)?.contains("_geo"); let is_filterable = index.filterable_fields(rtxn)?.contains("_geo");
if is_sortable || is_filterable { if is_sortable || is_filterable {
// Ok(Some(GeoExtractor { rtree: index.geo_rtree(rtxn)? }))
Ok(Some(GeoExtractor { grenad_parameters })) Ok(Some(GeoExtractor { grenad_parameters }))
} else { } else {
Ok(None) Ok(None)
@ -61,14 +56,12 @@ unsafe impl MostlySend for GeoExtractorData<'_> {}
impl<'extractor> Extractor<'extractor> for GeoExtractor { impl<'extractor> Extractor<'extractor> for GeoExtractor {
type Data = RefCell<GeoExtractorData<'extractor>>; type Data = RefCell<GeoExtractorData<'extractor>>;
fn init_data<'doc>( fn init_data<'doc>(&'doc self, extractor_alloc: &'extractor Bump) -> Result<Self::Data> {
&'doc self,
extractor_alloc: &'extractor bumpalo::Bump,
) -> Result<Self::Data> {
Ok(RefCell::new(GeoExtractorData { Ok(RefCell::new(GeoExtractorData {
inserted: Uell::new_in(extractor_alloc), inserted: Uell::new_in(extractor_alloc),
removed: Bbbul::new_in(extractor_alloc), removed: Bbbul::new_in(extractor_alloc),
spilled: None, spilled_removed: None,
spilled_inserted: None,
})) }))
} }
@ -91,7 +84,7 @@ impl<'extractor> Extractor<'extractor> for GeoExtractor {
let updated_geo = update.updated().geo_field()?; let updated_geo = update.updated().geo_field()?;
// ... // ...
} }
DocumentChange::Insertion(insertion) => todo!(), DocumentChange::Insertion(insertion) => {}
} }
} }