class SearchSortScore extends SearchSort implements JsonSerializable (View source)

Sort by the hit score.

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

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

SearchSortScore descending(bool $descending)

Direction of the sort

Parameters

bool $descending

Return Value

SearchSortScore