plug in the document deletion in cellulite

This commit is contained in:
Tamo
2025-07-22 16:41:43 +02:00
parent e923154c90
commit 3a6505fcaa
3 changed files with 5 additions and 13 deletions

View File

@ -169,7 +169,7 @@ fn extract_geojson_field(
obkv: &obkv::KvReader<FieldId>,
settings: &InnerIndexSettings,
deladd: DelAdd,
document_id: impl Fn() -> Value,
_document_id: impl Fn() -> Value,
) -> Result<Option<GeoJson>> {
match settings.geojson_fid {
Some(fid) if settings.filterable_attributes_rules.iter().any(|rule| rule.has_geojson()) => {

View File

@ -158,7 +158,6 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
match change? {
DocumentChange::Deletion(deletion) => {
let docid = deletion.docid();
let external_id = deletion.external_document_id();
let current = deletion.current(rtxn, index, db_fields_ids_map)?;
if let Some(geojson) = current.geojson_field()? {
@ -176,7 +175,6 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
}
DocumentChange::Update(update) => {
let current = update.current(rtxn, index, db_fields_ids_map)?;
let external_id = update.external_document_id();
let docid = update.docid();
let current_geo = current.geojson_field()?;
@ -218,7 +216,6 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
}
}
DocumentChange::Insertion(insertion) => {
let external_id = insertion.external_document_id();
let docid = insertion.docid();
let inserted_geo = insertion.inserted().geojson_field()?;

View File

@ -66,8 +66,8 @@ where
#[tracing::instrument(level = "trace", skip_all, target = "indexing::merge")]
pub fn merge_and_send_cellulite<'extractor, MSP>(
datastore: impl IntoIterator<Item = RefCell<GeoJsonExtractorData<'extractor>>>,
rtxn: &RoTxn,
index: &Index,
_rtxn: &RoTxn,
_index: &Index,
geojson_sender: GeoJsonSender<'_, '_>,
must_stop_processing: &MSP,
) -> Result<()>
@ -81,13 +81,8 @@ where
let mut frozen = data.into_inner().freeze()?;
for result in frozen.iter_and_clear_removed()? {
let extracted_geo_point = result.map_err(InternalError::SerdeJson)?;
/// Fix that
todo!("We must send the docid instead of the geojson");
/*
let removed = cellulite.remove(&GeoJsonPoint::from(extracted_geo_point));
debug_assert!(removed.is_some());
*/
let (docid, _) = result.map_err(InternalError::SerdeJson)?;
geojson_sender.delete_geojson(docid).unwrap();
}
for result in frozen.iter_and_clear_inserted()? {