pub struct Geo<S = Root> { /* private fields */ }Expand description
A geo_point field — the within query family (distance / box / polygon),
plus sort-by-distance.
Implementations§
Source§impl<S> Geo<S>
impl<S> Geo<S>
pub fn at(path: impl Into<String>) -> Self
Sourcepub fn within(
&self,
distance: Distance,
center: GeoPoint,
) -> GeoDistanceQuery<S>
pub fn within( &self, distance: Distance, center: GeoPoint, ) -> GeoDistanceQuery<S>
Points within distance (e.g. Distance::km(12.0)) of center. Returns
a GeoDistanceQuery builder for distance_type / validation_method
plus boost / name.
Sourcepub fn within_box(&self, top_left: GeoPoint, bottom_right: GeoPoint) -> Query<S>
pub fn within_box(&self, top_left: GeoPoint, bottom_right: GeoPoint) -> Query<S>
Points inside the axis-aligned box with the given corners.
Sourcepub fn within_polygon(
&self,
points: impl IntoIterator<Item = GeoPoint>,
) -> Query<S>
pub fn within_polygon( &self, points: impl IntoIterator<Item = GeoPoint>, ) -> Query<S>
Points inside the polygon described by points (three or more vertices).
Sourcepub fn distance_from(&self, center: GeoPoint) -> Sort
pub fn distance_from(&self, center: GeoPoint) -> Sort
Sort by distance from center, nearest first. Sugar for the common
_geo_distance sort: ascending, OpenSearch’s default unit (meters);
chain .desc() to flip it. For an explicit unit or order use
distance_sort.
Sourcepub fn distance_sort(
&self,
center: GeoPoint,
order: SortOrder,
unit: DistanceUnit,
) -> Sort
pub fn distance_sort( &self, center: GeoPoint, order: SortOrder, unit: DistanceUnit, ) -> Sort
Sort by distance from center, measured in unit.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Geo<S>
impl<S> RefUnwindSafe for Geo<S>
impl<S> Send for Geo<S>
impl<S> Sync for Geo<S>
impl<S> Unpin for Geo<S>
impl<S> UnsafeUnpin for Geo<S>
impl<S> UnwindSafe for Geo<S>
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