1. @sitecore-cloudsdk/search/server

GeoWithinFilter

Version:

Type

Class

Extends

BaseFilter

Import path

@sitecore-cloudsdk/search/server

A filter that returns search results depending on geographical data, such as an area defined by polygon area coordinates.

The coordinates form the polygonal area where Sitecore Search looks for search results.

latitude and longitude define one vertex of the polygon. For example, if you define four vertexes, Sitecore Search creates a four-sided area to filter results within.

Constructor

GeoWithinFilter(
  attributeName: string,
  geoWithinFilterData: GeoWithinFilterData
)

Parameters

Name

Type

Description

attributeName

string

The entity's attribute to match against the geographical data.

Example: "location"

geoWithinFilterData

GeoWithinFilterData

An array of geographical coordinates. Used for filtering search results.

Minimum length: 3.

Properties

Name

Type

Description

_attributeName

string

Required.

The entity's attribute to match against the geographical data.

Methods

_validateLocation

Validates latitude and longitude.

Signature

private _validateLocation(location: LocationData): void

Parameters

Name

Type

Description

location

LocationData

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

Overrides the site visitor's current location (geoData.location).

Return value

Returns void.

Errors

toDTO

Maps the GeoWithinFilter instance to its DTO (data transfer object) format.

Signature

toDTO(): GeoWithinFilterDTO

Return value

Returns the GeoWithinFilter instance in a standardized DTO format.

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