Class: Enums::SortModes

Inherits:
Object
  • Object
show all
Defined in:
lib/enums/sort_modes.rb

Overview

Elasticsearch supports sorting by array or multi-valued fields. The SortMode option controls what array value is picked for sorting the document it belongs to. The mode option can have the following values:

min - Pick the lowest value.

max - Pick the highest value.

sum - Use the sum of all values as sort value. Only applicable for number based array fields.

avg - Use the average of all values as sort value. Only applicable for number based array fields.

median - Use the median of all values as sort value. Only applicable for number based array fields.

Class Method Summary collapse

Class Method Details

.avgSortModes

Returns SortModes object corresponding to elasticsearch option of ‘avg’.

Returns:

  • (SortModes)

    SortModes object corresponding to elasticsearch option of ‘avg’



# File 'lib/enums/sort_modes.rb', line 44

.maxSortModes

Returns SortModes object corresponding to elasticsearch option of ‘max’.

Returns:

  • (SortModes)

    SortModes object corresponding to elasticsearch option of ‘max’



# File 'lib/enums/sort_modes.rb', line 34

.medianSortModes

Returns SortModes object corresponding to elasticsearch option of ‘median’.

Returns:

  • (SortModes)

    SortModes object corresponding to elasticsearch option of ‘median’



# File 'lib/enums/sort_modes.rb', line 49

.minSortModes

Returns SortModes object corresponding to elasticsearch option of ‘min’.

Returns:

  • (SortModes)

    SortModes object corresponding to elasticsearch option of ‘min’



# File 'lib/enums/sort_modes.rb', line 29

.sumSortModes

Returns SortModes object corresponding to elasticsearch option of ‘sum’.

Returns:

  • (SortModes)

    SortModes object corresponding to elasticsearch option of ‘sum’



# File 'lib/enums/sort_modes.rb', line 39