pub struct GeoPointStore { /* private fields */ }Expand description
Per-segment geo point storage.
Stores (lat, lon) pairs as parallel f64 arrays indexed by doc_id. On deserialization, builds a latitude-sorted index for O(log n) range queries.
See [[optimization-bkd-tree-geo]] for the sorted scan optimization.
Implementations§
Source§impl GeoPointStore
impl GeoPointStore
pub fn new() -> Self
pub fn add(&mut self, point: GeoPoint)
pub fn add_null(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, doc_id: u32) -> Option<GeoPoint>
Sourcepub fn docs_in_lat_range(&self, min_lat: f64, max_lat: f64) -> Vec<u32>
pub fn docs_in_lat_range(&self, min_lat: f64, max_lat: f64) -> Vec<u32>
Returns doc IDs with latitude in [min_lat, max_lat], sorted by doc_id.
Uses binary search on the pre-sorted latitude index for O(log n + k) where k is the number of matching documents.
Sourcepub fn from_bytes(data: &[u8]) -> Self
pub fn from_bytes(data: &[u8]) -> Self
Deserialize from bytes.
Trait Implementations§
Source§impl Clone for GeoPointStore
impl Clone for GeoPointStore
Source§fn clone(&self) -> GeoPointStore
fn clone(&self) -> GeoPointStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GeoPointStore
impl RefUnwindSafe for GeoPointStore
impl Send for GeoPointStore
impl Sync for GeoPointStore
impl Unpin for GeoPointStore
impl UnsafeUnpin for GeoPointStore
impl UnwindSafe for GeoPointStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more