mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-19 03:06:26 +00:00
Cellulite is almost in the new indexer. We must add the documentID to the geojson pipeline
This commit is contained in:
@ -13,6 +13,7 @@ use super::extract::{
|
||||
FacetKind, GeoExtractorData,
|
||||
};
|
||||
use crate::update::facet::new_incremental::FacetFieldIdChange;
|
||||
use crate::update::new::extract::cellulite::GeoJsonExtractorData;
|
||||
use crate::{CboRoaringBitmapCodec, FieldId, GeoPoint, Index, InternalError, Result};
|
||||
|
||||
#[tracing::instrument(level = "trace", skip_all, target = "indexing::merge")]
|
||||
@ -62,6 +63,43 @@ where
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
#[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,
|
||||
geojson_sender: GeoJsonSender<'_, '_>,
|
||||
must_stop_processing: &MSP,
|
||||
) -> Result<()>
|
||||
where
|
||||
MSP: Fn() -> bool + Sync,
|
||||
{
|
||||
let cellulite = cellulite::Writer::new(index.cellulite);
|
||||
|
||||
for data in datastore {
|
||||
if must_stop_processing() {
|
||||
return Err(InternalError::AbortedIndexation.into());
|
||||
}
|
||||
|
||||
let mut frozen = data.into_inner().freeze()?;
|
||||
for result in frozen.iter_and_clear_removed()? {
|
||||
let extracted_geo_point = result.map_err(InternalError::SerdeJson)?;
|
||||
todo!("We must send the docid instead of the geojson");
|
||||
/*
|
||||
let removed = cellulite.remove(&GeoJsonPoint::from(extracted_geo_point));
|
||||
debug_assert!(removed.is_some());
|
||||
*/
|
||||
}
|
||||
|
||||
for result in frozen.iter_and_clear_inserted()? {
|
||||
geojson_sender.send_geojson(result.map_err(InternalError::SerdeJson)?).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "trace", skip_all, target = "indexing::merge")]
|
||||
pub fn merge_and_send_docids<MSP, D>(
|
||||
mut caches: Vec<BalancedCaches<'_>>,
|
||||
|
Reference in New Issue
Block a user