mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-05 20:26:31 +00:00
plug in the document deletion in cellulite
This commit is contained in:
@ -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()) => {
|
||||
|
@ -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()?;
|
||||
|
@ -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()? {
|
||||
|
Reference in New Issue
Block a user