diff --git a/milli/src/update/index_documents/extract/extract_geo_points.rs b/milli/src/update/index_documents/extract/extract_geo_points.rs index 9f6e43199..0a73e5ed4 100644 --- a/milli/src/update/index_documents/extract/extract_geo_points.rs +++ b/milli/src/update/index_documents/extract/extract_geo_points.rs @@ -31,9 +31,9 @@ pub fn extract_geo_points( let point = obkv.get(geo_field_id).unwrap(); // TODO: TAMO where should we handle this error? let point: Value = serde_json::from_slice(point).map_err(InternalError::SerdeJson)?; - if let Some((lat, long)) = point["lat"].as_f64().zip(point["long"].as_f64()) { + if let Some((lat, lng)) = point["lat"].as_f64().zip(point["lng"].as_f64()) { // this will create an array of 16 bytes (two 8 bytes floats) - let bytes: [u8; 16] = concat_arrays![lat.to_le_bytes(), long.to_le_bytes()]; + let bytes: [u8; 16] = concat_arrays![lat.to_le_bytes(), lng.to_le_bytes()]; writer.insert(docid_bytes, bytes)?; } else { // TAMO: improve the warn diff --git a/milli/src/update/index_documents/typed_chunk.rs b/milli/src/update/index_documents/typed_chunk.rs index dcefee153..0dfeabece 100644 --- a/milli/src/update/index_documents/typed_chunk.rs +++ b/milli/src/update/index_documents/typed_chunk.rs @@ -189,8 +189,8 @@ pub(crate) fn write_typed_chunk_into_index( // convert the latitude and longitude back to a f64 (8 bytes) let (lat, tail) = helpers::try_split_array_at::(value).unwrap(); - let (long, _) = helpers::try_split_array_at::(tail).unwrap(); - let point = [f64::from_le_bytes(lat), f64::from_le_bytes(long)]; + let (lng, _) = helpers::try_split_array_at::(tail).unwrap(); + let point = [f64::from_le_bytes(lat), f64::from_le_bytes(lng)]; rtree.insert(GeoPoint::new(point, key)); } index.put_geo_rtree(wtxn, &rtree)?;