Create a geographic filter for location-based searches.
This is a convenience function that provides a fluent API for building geo filters. Geo filters support radius-based geographic queries using longitude/latitude coordinates.
Geo(field: string): __type| Name | Type | Description |
|---|---|---|
field* | string | The name of the geo field to filter on |
// Find locations within radius
const filter = Geo("location").within(-122.4194, 37.7749, 10, "km");
// Find locations outside radius
const filter = Geo("location").outside(-74.0060, 40.7128, 50, "mi");
// Combine with other filters
const complexFilter = Geo("store_location").within(-122.4194, 37.7749, 5, "km")
.and(Tag("store_type").eq("retail"));