1. @sitecore-cloudsdk/search/server

GeoFilterData

Version:

Type

Interface

Import path

@sitecore-cloudsdk/search/server

Geographical data used for filtering search results.

Signature

export interface GeoFilterData {
  distance?: DistanceString;
  location?: LocationData;
}

Properties

Name

Type

Description

Value

distance

DistanceString

Optional.

The radius of the circular geographical area where you want Sitecore Search to return suitable search results for.

For example, return search results only for those products that are available for purchase in the area.

Format: A number followed by a unit of distance, without spaces.

Accepted units:

  • in - inches

  • ft - feet

  • yd - yards

  • nmi - nautical miles

  • mm - millimeters

  • cm - centimeters

  • m - meters

  • km - kilometers

  • "8.6ft"

  • "16km"

location

LocationData

Optional.

The geographical coordinates of the location that the site visitor wants to see search results for.

In filters, location represents a location different than the site visitor's current one.

By default, Sitecore Search returns search results relevant to the site visitor's current location (geoData.location).

geoFilterData.location lets you override the site visitor's current location values with different ones. This lets you return search results for a different location instead of the site visitor's current location.

For example, if the site visitor wants to see a list of stores in a different city, not nearby stores, provide that city's location data in geoFilterData.location.

N/A

If you have suggestions for improving this article, let us know!