mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-06 12:46:31 +00:00
fmt
This commit is contained in:
@ -1150,15 +1150,11 @@ impl GeoSender<'_, '_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub struct GeoJsonSender<'a, 'b>(&'a ExtractorBbqueueSender<'b>);
|
pub struct GeoJsonSender<'a, 'b>(&'a ExtractorBbqueueSender<'b>);
|
||||||
|
|
||||||
impl GeoJsonSender<'_, '_> {
|
impl GeoJsonSender<'_, '_> {
|
||||||
pub fn send_geojson(&self, docid: DocumentId, value: GeoJson) -> StdResult<(), SendError<()>> {
|
pub fn send_geojson(&self, docid: DocumentId, value: GeoJson) -> StdResult<(), SendError<()>> {
|
||||||
self.0
|
self.0.sender.send(ReceiverAction::GeoJson(docid, value)).map_err(|_| SendError(()))
|
||||||
.sender
|
|
||||||
.send(ReceiverAction::GeoJson(docid, value))
|
|
||||||
.map_err(|_| SendError(()))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,8 @@ pub struct FrozenGeoJsonExtractorData<'extractor> {
|
|||||||
impl FrozenGeoJsonExtractorData<'_> {
|
impl FrozenGeoJsonExtractorData<'_> {
|
||||||
pub fn iter_and_clear_removed(
|
pub fn iter_and_clear_removed(
|
||||||
&mut self,
|
&mut self,
|
||||||
) -> io::Result<impl IntoIterator<Item = Result<(DocumentId, GeoJson), serde_json::Error>> + '_> {
|
) -> io::Result<impl IntoIterator<Item = Result<(DocumentId, GeoJson), serde_json::Error>> + '_>
|
||||||
|
{
|
||||||
Ok(mem::take(&mut self.removed)
|
Ok(mem::take(&mut self.removed)
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
@ -109,7 +110,8 @@ impl FrozenGeoJsonExtractorData<'_> {
|
|||||||
|
|
||||||
pub fn iter_and_clear_inserted(
|
pub fn iter_and_clear_inserted(
|
||||||
&mut self,
|
&mut self,
|
||||||
) -> io::Result<impl IntoIterator<Item = Result<(DocumentId, GeoJson), serde_json::Error>> + '_> {
|
) -> io::Result<impl IntoIterator<Item = Result<(DocumentId, GeoJson), serde_json::Error>> + '_>
|
||||||
|
{
|
||||||
Ok(mem::take(&mut self.inserted)
|
Ok(mem::take(&mut self.inserted)
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
@ -215,9 +217,10 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
|
|||||||
file.write_all(geojson.get().as_bytes())?;
|
file.write_all(geojson.get().as_bytes())?;
|
||||||
}
|
}
|
||||||
// TODO: Should be an internal error
|
// TODO: Should be an internal error
|
||||||
None => data_ref.removed.push(
|
None => data_ref.removed.push((
|
||||||
(docid, GeoJson::from_str(geojson.get()).map_err(UserError::from)?),
|
docid,
|
||||||
),
|
GeoJson::from_str(geojson.get()).map_err(UserError::from)?,
|
||||||
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,9 +231,10 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
|
|||||||
file.write_all(geojson.get().as_bytes())?;
|
file.write_all(geojson.get().as_bytes())?;
|
||||||
}
|
}
|
||||||
// TODO: Is the error type correct here? Shouldn't it be an internal error?
|
// TODO: Is the error type correct here? Shouldn't it be an internal error?
|
||||||
None => data_ref.inserted.push(
|
None => data_ref.inserted.push((
|
||||||
(docid, GeoJson::from_str(geojson.get()).map_err(UserError::from)?),
|
docid,
|
||||||
),
|
GeoJson::from_str(geojson.get()).map_err(UserError::from)?,
|
||||||
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,9 +252,10 @@ impl<'extractor> Extractor<'extractor> for GeoJsonExtractor {
|
|||||||
file.write_all(geojson.get().as_bytes())?;
|
file.write_all(geojson.get().as_bytes())?;
|
||||||
}
|
}
|
||||||
// TODO: Is the error type correct here? Shouldn't it be an internal error?
|
// TODO: Is the error type correct here? Shouldn't it be an internal error?
|
||||||
None => data_ref.inserted.push(
|
None => data_ref.inserted.push((
|
||||||
(docid, GeoJson::from_str(geojson.get()).map_err(UserError::from)?),
|
docid,
|
||||||
),
|
GeoJson::from_str(geojson.get()).map_err(UserError::from)?,
|
||||||
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,9 +320,9 @@ where
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
'cellulite: {
|
'cellulite: {
|
||||||
let Some(extractor) = GeoJsonExtractor::new(&rtxn, index, *indexing_context.grenad_parameters)?
|
let Some(extractor) =
|
||||||
|
GeoJsonExtractor::new(&rtxn, index, *indexing_context.grenad_parameters)?
|
||||||
else {
|
else {
|
||||||
break 'cellulite;
|
break 'cellulite;
|
||||||
};
|
};
|
||||||
|
@ -63,7 +63,6 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[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>>>,
|
||||||
|
Reference in New Issue
Block a user