class SearchSortField extends SearchSort implements JsonSerializable (View source)

Sort by a field in the hits.

Constants

TYPE_AUTO

TYPE_STRING

TYPE_NUMBER

TYPE_DATE

MODE_DEFAULT

MODE_MIN

MODE_MAX

MISSING_FIRST

MISSING_LAST

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

type(string $type)

Set type of the field

mode(string $mode)

Set mode of the sort

missing(string $missing)

Set where the hits with missing field will be inserted

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

SearchSortField descending(bool $descending)

Direction of the sort

Parameters

bool $descending

Return Value

SearchSortField

type(string $type)

Set type of the field

Parameters

string $type

the type

See also

SearchSortField::TYPE_AUTO
SearchSortField::TYPE_STRING
SearchSortField::TYPE_NUMBER
SearchSortField::TYPE_DATE

mode(string $mode)

Set mode of the sort

Parameters

string $mode

the mode

See also

SearchSortField::MODE_MIN
SearchSortField::MODE_MAX

missing(string $missing)

Set where the hits with missing field will be inserted

Parameters

string $missing

strategy for hits with missing fields

See also

SearchSortField::MISSING_FIRST
SearchSortField::MISSING_LAST