class SearchSortGeoDistance extends SearchSort implements JsonSerializable (View source)

Sort by a location and unit in the hits.

Methods

static SearchSortId
id()

Sort by the document identifier.

static SearchSortScore
score()

Sort by the hit score.

static SearchSortField
field(string $field)

Sort by a field in the hits.

geoDistance(string $field, float $longitude, float $latitude)

Sort by geo location.

descending(bool $descending)

Direction of the sort

unit(string $unit)

Name of the units

Details

static SearchSortId id()

Sort by the document identifier.

Return Value

SearchSortId

static SearchSortScore score()

Sort by the hit score.

Return Value

SearchSortScore

static SearchSortField field(string $field)

Sort by a field in the hits.

Parameters

string $field

the field name

Return Value

SearchSortField

static SearchSortGeoDistance geoDistance(string $field, float $longitude, float $latitude)

Sort by geo location.

Parameters

string $field

the field name

float $longitude

the longitude of the location

float $latitude

the latitude of the location

Return Value

SearchSortGeoDistance

SearchSortGeoDistance descending(bool $descending)

Direction of the sort

Parameters

bool $descending

Return Value

SearchSortGeoDistance

SearchSortGeoDistance unit(string $unit)

Name of the units

Parameters

string $unit

Return Value

SearchSortGeoDistance