mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-06 04:36:32 +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>,
|
obkv: &obkv::KvReader<FieldId>,
|
||||||
settings: &InnerIndexSettings,
|
settings: &InnerIndexSettings,
|
||||||
deladd: DelAdd,
|
deladd: DelAdd,
|
||||||
document_id: impl Fn() -> Value,
|
_document_id: impl Fn() -> Value,
|
||||||
) -> Result<Option<GeoJson>> {
|
) -> Result<Option<GeoJson>> {
|
||||||
match settings.geojson_fid {
|
match settings.geojson_fid {
|
||||||
Some(fid) if settings.filterable_attributes_rules.iter().any(|rule| rule.has_geojson()) => {
|
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? {
|
match change? {
|
||||||
DocumentChange::Deletion(deletion) => {
|
DocumentChange::Deletion(deletion) => {
|
||||||
let docid = deletion.docid();
|
let docid = deletion.docid();
|
||||||
let external_id = deletion.external_document_id();
|
|
||||||
let current = deletion.current(rtxn, index, db_fields_ids_map)?;
|
let current = deletion.current(rtxn, index, db_fields_ids_map)?;
|
||||||
|
|
||||||
if let Some(geojson) = current.geojson_field()? {
|
if let Some(geojson) = current.geojson_field()? {
|
||||||
@ -176,7 +175,6 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
|
|||||||
}
|
}
|
||||||
DocumentChange::Update(update) => {
|
DocumentChange::Update(update) => {
|
||||||
let current = update.current(rtxn, index, db_fields_ids_map)?;
|
let current = update.current(rtxn, index, db_fields_ids_map)?;
|
||||||
let external_id = update.external_document_id();
|
|
||||||
let docid = update.docid();
|
let docid = update.docid();
|
||||||
|
|
||||||
let current_geo = current.geojson_field()?;
|
let current_geo = current.geojson_field()?;
|
||||||
@ -218,7 +216,6 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
DocumentChange::Insertion(insertion) => {
|
DocumentChange::Insertion(insertion) => {
|
||||||
let external_id = insertion.external_document_id();
|
|
||||||
let docid = insertion.docid();
|
let docid = insertion.docid();
|
||||||
|
|
||||||
let inserted_geo = insertion.inserted().geojson_field()?;
|
let inserted_geo = insertion.inserted().geojson_field()?;
|
||||||
|
@ -66,8 +66,8 @@ where
|
|||||||
#[tracing::instrument(level = "trace", skip_all, target = "indexing::merge")]
|
#[tracing::instrument(level = "trace", skip_all, target = "indexing::merge")]
|
||||||
pub fn merge_and_send_cellulite<'extractor, MSP>(
|
pub fn merge_and_send_cellulite<'extractor, MSP>(
|
||||||
datastore: impl IntoIterator<Item = RefCell<GeoJsonExtractorData<'extractor>>>,
|
datastore: impl IntoIterator<Item = RefCell<GeoJsonExtractorData<'extractor>>>,
|
||||||
rtxn: &RoTxn,
|
_rtxn: &RoTxn,
|
||||||
index: &Index,
|
_index: &Index,
|
||||||
geojson_sender: GeoJsonSender<'_, '_>,
|
geojson_sender: GeoJsonSender<'_, '_>,
|
||||||
must_stop_processing: &MSP,
|
must_stop_processing: &MSP,
|
||||||
) -> Result<()>
|
) -> Result<()>
|
||||||
@ -81,13 +81,8 @@ where
|
|||||||
|
|
||||||
let mut frozen = data.into_inner().freeze()?;
|
let mut frozen = data.into_inner().freeze()?;
|
||||||
for result in frozen.iter_and_clear_removed()? {
|
for result in frozen.iter_and_clear_removed()? {
|
||||||
let extracted_geo_point = result.map_err(InternalError::SerdeJson)?;
|
let (docid, _) = result.map_err(InternalError::SerdeJson)?;
|
||||||
/// Fix that
|
geojson_sender.delete_geojson(docid).unwrap();
|
||||||
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()? {
|
for result in frozen.iter_and_clear_inserted()? {
|
||||||
|
Reference in New Issue
Block a user